TypeError: Image data can not convert to float

前端 未结 12 737
醉话见心
醉话见心 2020-12-17 07:45

I am trying to create a 16-bit image like so:

import skimage 
import random
from random import randint                        
xrow=raw_input("Enter the          


        
12条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-17 08:23

    I was also getting this error, and the answers given above says that we should upload them first and then use their name instead of a path - but for Kaggle dataset, this is not possible.

    Hence the solution I figure out is by reading the the individual image in a loop in mpimg format. Here we can use the path and not just the image name.

    I hope it will help you guys.

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

提交回复
热议问题