Hru*_*shi 5 hdf5 google-colaboratory
我的驱动器中有 4 个 hdf5 文件。使用 colab 时,db=h5py.File(path_to_file, "r")有时可以工作,其余时间则不工作。在写入hdf5文件时,我确保写入后将其关闭。假设 File1 在笔记本_#1 上工作,当我尝试在笔记本_#2 上使用它时,它有时工作,有时不工作。当我在笔记本_#1 上再次运行它时,它可能有效,也可能无效。
大小可能不是问题,因为我的 4 个文件是 32GB,其他文件是 4GB,而且大多数问题都出在 4GB 文件上。
hdf5 文件是使用 colab 本身生成的。我得到的错误是:
OSError: Unable to open file (file read failed: time = Tue May 19 12:58:36 2020
, filename = '/content/drive/My Drive/Hrushi/dl4cv/hdf5_files/train.hdf5', file descriptor = 61, errno = 5, error message = 'Input/output error', buf = 0x7ffc437c4c20, total read size = 8, bytes this sub-read = 8, bytes actually read = 18446744073709551615, offset = 0
Run Code Online (Sandbox Code Playgroud)
或者
/usr/local/lib/python3.6/dist-packages/h5py/_hl/files.py in make_fid(name, mode, userblock_size, fapl, fcpl, swmr)
171 if swmr and swmr_support:
172 flags |= h5f.ACC_SWMR_READ
--> 173 fid = h5f.open(name, flags, fapl=fapl)
174 elif mode == 'r+':
175 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 (bad object header version number)
Run Code Online (Sandbox Code Playgroud)
将不胜感激任何帮助,提前致谢。
| 归档时间: |
|
| 查看次数: |
1987 次 |
| 最近记录: |