machine-learning - 无法在 google colab 中加载文件
问题描述
我正在尝试在 google colab 中加载经过训练的网络,但出现以下错误。
<ipython-input-6-9d26dabb123d> in <module>()
----> 1 l3structure1_decoder = load_model("/content/gdrive/My Drive/DATA/TRAINED NETWORKS/ALL_MODELS/decoder_finalp1_structure_l3_vels_max7_min0.h5")
4 frames
/usr/local/lib/python3.6/dist-packages/h5py/_hl/files.py in make_fid(name, mode, userblock_size, fapl, fcpl, swmr)
140 if swmr and swmr_support:
141 flags |= h5f.ACC_SWMR_READ
--> 142 fid = h5f.open(name, flags, fapl=fapl)
143 elif mode == 'r+':
144 fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/h5f.pyx in h5py.h5f.open()
OSError: Unable to open file (file read failed: time = Mon Feb 24 08:58:41 2020
, filename = '/content/gdrive/My Drive/DATA/TRAINED NETWORKS/ALL_MODELS/decoder_finalp1_structure_l3_vels_max7_min0.h5', file descriptor = 62, errno = 5, error message = 'Input/output error', buf = 0x7ffdde98baf0, total read size = 8, bytes this sub-read = 8, bytes actually read = 18446744073709551615, offset = 0) ```
解决方案
我也遇到了类似的问题。
只需
os.environ["HDF5_USE_FILE_LOCKING"] = "FALSE"
在阅读文件之前做,它就像魔术一样工作。
推荐阅读
- laravel - Laravel websocket 的网址是什么?
- c# - 教程视频是 2018 年制作的,需要帮助。应该是开关
- reactjs - 如何从我编写的自定义表单的子组件修改父组件的状态。这也可能影响父母的其他孩子
- logging - 在 Sublime Text 3 中默认/启动时记录命令?
- java - 在 JAVA 中的 JSON 反序列化期间更改两个文件名
- node.js - 在 yarn install 上编译 node-sass 时出错
- github - 如何在已经存在的存储库中添加一个空文件夹?Github
- javascript - 遍历js中的数组
- c# - Unity Player 跳转:何时使用 RaycastHit 以及何时使用 OnCollisionEnter
- python-3.x - 有没有办法在熊猫中将数字月/日/年转换为字母形式的月/日/年?