Forums

what is OSError: -2 ?

%%time Image.MAX_IMAGE_PIXELS = None size = (512,512)

sample_slides = train_df.sample(n=3, random_state=1) fig, axs = plt.subplots(1, 3, figsize = (12, 12))

for i in range(len(sample_slides.index)):

slide = Image.open(sample_slides.iloc[i]['image_path'])
slide.thumbnail(size)
axs[i].set_title(f'Image Size: {slide.size}')
axs[i].imshow(slide)

plt.show()

i want to have a look on my tiff image, but it can't be done and the error shows (OSError: -2)

Does it try to display something where there is no screen?