无法在Google Colab中加载文件

时间:2020-02-24 09:10:23

标签: machine-learning deep-learning google-colaboratory

我正在尝试在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) ```

1 个答案:

答案 0 :(得分:3)

我也遇到了类似的问题。

简单地做 os.environ["HDF5_USE_FILE_LOCKING"] = "FALSE" 在读取文件之前,它就像魔术一样工作。

取自https://groups.google.com/forum/#!topic/h5py/0kgiMVGSTBE