**报错:
- ImportError:
save_model
requires h5py - OSError: Unable to create file (unable to open file: name = ‘.
et_classification.h5’, errno = 22, error message = ‘Invalid argument’, flags = 13, o_flags = 302)。等问题**
Python/Tensorflow/Keras版本对应,按理说Tensorflow 2.x已经集成了Keras 如果有报错可能需要检查一下版本对应。
关于h5py,Tensorflow2.1 不支持 h5py >= 3.0.0。
可参考我所用的版本对应:
Python 3.8(conda) + Tensorflow 2.0.0 + Keras 2.3.0 + h5py 2.10.0
重装h5py库:
pip uninstall h5py
pip install h5py
如果在保存文件时还出现OSError: Unable to create file (unable to open file: name = ‘. et_classification.h5‘, errno = 2的问题:
注意以下四个方面的问题
1、相对路径改成绝对路径
注意: .\不要漏掉那个点
2、修改路径(把路径写全)
3、没有创建该文件,系统找不到该文件
4、文件被占用,在某一程序中被打开
5、文件无权访问,点击属性,高级设置,打开访问权限