【问题标题】:Input/output error while using google colab to read Google dirve files使用 google colab 读取 Google 驱动器文件时出现输入/输出错误
【发布时间】:2022-05-05 22:20:41
【问题描述】:

我正在使用 colab 训练我的模型。 当我使用 colab 中的枚举函数在 Google Drive 上迭代我的训练数据时,我不止一次遇到此错误。 错误发生的时间不确定。错误可能是在训练了几个 epoch 之后,也可能发生在几个迭代中。

我尝试在Google Drive中修改数据集的路径,或者减小batchsize,这些都没有效果。

   192     batch_time = AverageMeter()
   193     losses = AverageMeter()
--> 194     for i, sample in enumerate(train_loader):
   195         start = time.time()
   196         input = sample['image'].cuda()
File "/usr/local/lib/python3.6/dist-packages/PIL/Image.py", line 2530, in open
    fp = builtins.open(filename, "rb")
OSError: [Errno 5] Input/output error: './nyud_cropped/train_labels/001187.png'

【问题讨论】:

    标签: python google-colaboratory


    【解决方案1】:

    我的建议是在训练之前先将数据从 Drive 复制到临时 VM 机器。这也可能加快速度。

    【讨论】:

    • Moving data to the ephemeral VM machine成功解决了我的问题,非常感谢您的建议:)
    最近更新 更多