【发布时间】:2019-12-11 09:25:48
【问题描述】:
我试图使用我在网上找到的代码查看 jpeg 文件。
代码如下:
from PIL import Image
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
image = Image.open('/kaggle/input/chest-xray-pneumonia/chest_xray/__MACOSX/chest_xray/test/PNEUMONIA/._person121_bacteria_576.jpeg')
image.show()
但我收到此错误:
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-1-637f422434fd> in <module>
19
20
---> 21 image = Image.open('/kaggle/input/chest-xray-pneumonia/chest_xray/__MACOSX/chest_xray/test/PNEUMONIA/._person121_bacteria_576.jpeg')
22 image.show()
/opt/conda/lib/python3.6/site-packages/PIL/Image.py in open(fp, mode)
2685 warnings.warn(message)
2686 raise IOError("cannot identify image file %r"
-> 2687 % (filename if filename else fp))
2688
2689 #
OSError: cannot identify image file '/kaggle/input/chest-xray-pneumonia/chest_xray/__MACOSX/chest_xray/test/PNEUMONIA/._person121_bacteria_576.jpeg'
我想知道这是否是一个问题,因为我没有加载数据或其他什么? 我在带有数据集的 Kagglenotebook 上的笔记本上没有写任何其他内容:https://www.kaggle.com/paultimothymooney/chest-xray-pneumonia
【问题讨论】: