DeepLearningLifeSciences icon indicating copy to clipboard operation
DeepLearningLifeSciences copied to clipboard

problem in data_loader.py

Open TheStoneMX opened this issue 5 years ago • 1 comments

in the static function load_img() you are using SciPy.misc.imread() which is deprecated in SciPy 1.0.0, and removed in 1.2.0... and the lattes version is 1.2.2 in order for the code to work, I had to do this.

@staticmethod def load_img(image_files):

images = []

for image_file in image_files:
  _, extension = os.path.splitext(image_file)
  extension = extension.lower()
  
  if extension == ".png":
    im = Image.open(image_file)
    imarray = np.array(im)
    images.append(imarray)
    #image = misc.imread(image_file)
    #images.append(image)
  elif extension == ".tif":
    im = Image.open(image_file)
    imarray = np.array(im)
    images.append(imarray)
  else:
    raise ValueError("Unsupported image filetype for %s" % image_file)
return np.array(images)

Besides I don't understand why you are using to read images functions from to different libraries.....

TheStoneMX avatar Jul 27 '19 16:07 TheStoneMX

@TheStoneMX Thanks for the bug report! I've marked this as a bug and will try to get a fix merged in

rbharath avatar Aug 13 '19 22:08 rbharath