【发布时间】:2020-10-31 23:24:28
【问题描述】:
!wget https://github.com/lazyprogrammer/machine_learning_examples/blob/master/cnn_class/lena.png
from PIL import Image
im =Image.open('lena.png')
UnidentifiedImageError Traceback(最近一次调用最后一次) 在 () ----> 1 im =Image.open('lena.png')
/usr/local/lib/python3.6/dist-packages/PIL/Image.py in open(fp, mode) 2929 警告。警告(消息) 第2930章 -> 2931 "无法识别图像文件 %r" % (filename if filename else fp) 第2932章 2933
UnidentifiedImageError: 无法识别图像文件 'lena.png'
【问题讨论】:
-
我认为
!允许您运行shell 命令,如果是这样,请在使用!ls -l lena.png打开文件之前检查Lena 是否存在
标签: python-3.x numpy random python-imaging-library numpy-ndarray