Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError:'save_weights' requires h5py

Tags:

keras

When I save weights during training my CNN model using keras, it says ImportError:'save_weights' requires h5py, but I have already installed h5py.

I would greatly appreciate if someone could explain how to fix this issue.

like image 412
Xiu Hu Avatar asked Apr 13 '17 07:04

Xiu Hu


3 Answers

I was getting the same error as you. I installed all the requirements listed here: https://github.com/fchollet/keras/issues/3426

Finally just needed to reboot and it started working.

like image 86
Arjun Mishra Avatar answered Oct 29 '22 05:10

Arjun Mishra


Just install necessary packages

sudo apt-get install libhdf5-dev

pip install h5py

like image 29
zhang Avatar answered Oct 29 '22 03:10

zhang


If you are using windows and python IDE, open cmd and input following commands:

pip install h5py

pip install cython

I hope it helps.

like image 43
Khan Avatar answered Oct 29 '22 04:10

Khan