搭建网络时出现ImportError: `save_model` requires h5py问题

**报错:

  1. ImportError: save_model requires h5py
  2. 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、文件无权访问,点击属性,高级设置,打开访问权限
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值