Anaconda
OSError: cannot identify image file ‘xxxx.jpg’
(1)应该是新版pillow的问题,通过pillow解决:
conda install Pillow==4.2.1
上述方案无效
(2)在image.open()时直接通过try……except忽略问题
try:
image = Image.open(os.path.join(directory, self.image_tmpl.format(idx))).convert('RGB')
except (OSError, NameError):
print('OSError')
问题是不知道image变量怎么初始化。。。
(3)尝试安装Pillow==3.2.0
(4)尝试Image.open(open(“path/to/file”, ‘rb’))
(5)仔细看了一下,好像是文件的问题,那个图片虽然存在但大小只有0B?解压或者复制的时候出错了?替换文件之后再尝试
Pytorch
RuntimeError: cuda runtime error (59)
RuntimeError: cuda runtime error (59): device-side assert triggered at /opt/conda/conda-bld/pytorch_1525796793591/work/torch/lib/THC/generic/THCStorage.c:36
terminate called without an active exception
解决方法:检查class数量是否设置正确