close
0

TypeError: Image data can not convert to float

avatar
asked 23-06-2022

3 Answers


0

Try

image = plt.imread(//image_path)
plt.imshow(image)
avatar
answered 23-06-2022

0

Use 

import matplotlib.image as mpimg
for img in os.listdir("/content/train"): 
  image = mpimg.imread(path)
  plt.imshow(image)
  plt.show()
avatar
answered 23-06-2022

0

Try

plt.imshow(im.reshape(im.shape[0], im.shape[1]), cmap=plt.cm.Greys)
avatar
answered 23-06-2022