【问题标题】:Not able to load files in google colab无法在 google colab 中加载文件
【发布时间】:2020-06-07 21:17:02
【问题描述】:

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

【问题讨论】:

  • 您是否尝试先将文件复制到 google colab 实例文件系统然后尝试打开它?

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


【解决方案1】:

我也遇到过类似的问题。

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-11-07
    • 2019-12-29
    • 2023-02-02
    • 2021-06-04
    • 2020-10-18
    • 2019-05-14
    • 2019-11-17
    • 2021-03-13
    相关资源
    最近更新 更多