0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

TypeError: Image data of dtype object cannot be converted to float

Last updated at Posted at 2020-01-28

エラー

from PIL import *
import numpy as np
import matplotlib.pyplot as plt
filename = "/content/kangaroo/images/00090.jpg"#https://github.com/experiencor/kangaroo/blob/master/images/00090.jpg
with Image.open(filename) as image:
  plt.imshow(image)

# TypeError: Image data of dtype object cannot be converted to float

解決

ImageFile.LOAD_TRUNCATED_IMAGES = True

ほかの画像はエラーは起きない。原因は何だろう。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?