由于训练了pytorch模型以进行狗图像分类,因此图像文件被截断了

时间:2019-04-03 08:32:50

标签: python pytorch

随着pytorch的CNN模型开始训练,错误如下:

OSError: Traceback (most recent call last):
  File "X:\soft\task\taskinstalled\Anaconda3\envs\dogged\lib\site-packages\torch\utils\data\dataloader.py", line 138, in _worker_loop
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "X:\soft\task\taskinstalled\Anaconda3\envs\dogged\lib\site-packages\torch\utils\data\dataloader.py", line 138, in <listcomp>
    samples = collate_fn([dataset[i] for i in batch_indices])
  File "X:\soft\task\taskinstalled\Anaconda3\envs\dogged\lib\site-packages\torchvision\datasets\folder.py", line 132, in __getitem__
    sample = self.loader(path)
  File "X:\soft\task\taskinstalled\Anaconda3\envs\dogged\lib\site-packages\torchvision\datasets\folder.py", line 178, in default_loader
    return pil_loader(path)
  File "X:\soft\task\taskinstalled\Anaconda3\envs\dogged\lib\site-packages\torchvision\datasets\folder.py", line 161, in pil_loader
    return img.convert('RGB')
  File "X:\soft\task\taskinstalled\Anaconda3\envs\dogged\lib\site-packages\PIL\Image.py", line 844, in convert
    self.load()
  File "X:\soft\task\taskinstalled\Anaconda3\envs\dogged\lib\site-packages\PIL\ImageFile.py", line 226, in load
    "(%d bytes not processed)" % len(b))
OSError: image file is truncated (150 bytes not processed)

0 个答案:

没有答案