我無法保存以h5py格式訓練過的神經網絡。它顯示以下錯誤:使用keras無法保存訓練過的神經網絡
ImportError Traceback (most recent call last)
<ipython-input-64-0185b568b480> in <module>()
1 from keras.models import load_model
----> 2 model.save("MNISTclassifier.h5")
/usr/local/lib/python3.5/dist-packages/keras/engine/topology.py in save(self, filepath, overwrite, include_optimizer)
2470 """
2471 from ..models import save_model
-> 2472 save_model(self, filepath, overwrite, include_optimizer)
2473
2474 def save_weights(self, filepath, overwrite=True):
/usr/local/lib/python3.5/dist-packages/keras/models.py in save_model(model, filepath, overwrite, include_optimizer)
53
54 if h5py is None:
---> 55 raise ImportError('`save_model` requires h5py.')
56
57 def get_json_type(obj):
ImportError: `save_model` requires h5py.
即使我已經使用pip安裝h5py並導入它。 源代碼在這裏: https://github.com/tanmay-edgelord/HandwrittenDigitRecognition/blob/master/MNIST%20.ipynb
請問修復建議[這裏](https://github.com/fchollet/keras/issues/3426)解決問題了嗎? – dhinckley
重新啓動電腦解決了我的問題。我甚至沒有改變我的代碼。就像我甚至沒有添加評論。 –