Keras: ImportError: `save_model` requires h5py even thought the code already imported h5py

前端 未结 2 2044
花落未央
花落未央 2021-01-13 16:15

I ran into some trouble when trying to save a Keras model:

Here is my code:

import h5py
from keras.models import load_model

try:
    import h5py
            


        
相关标签:
2条回答
  • 2021-01-13 16:50

    Have you tried directly installing h5py? http://docs.h5py.org/en/latest/build.html

    Try running pip install h5py

    0 讨论(0)
  • 2021-01-13 17:03

    Make sure you use the latest version of Keras.

    Also, this error has been reported here in the keras github: https://github.com/fchollet/keras/issues/3426

    on linux:

    sudo apt-get install libhdf5
    sudo pip install h5py
    
    0 讨论(0)
提交回复
热议问题