scipy.misc相关模块被弃用
AttributeError: module ‘scipy.misc’ has no attribute ‘imread’, AttributeError: module ‘scipy.misc’ has no attribute ‘imresize’, AttributeError:module ‘scipy.misc’ has no attribute ‘imsave’。
原因:被官方弃用
方法一:降级scipy版本(不推荐)
方法二:替换方法
对于imread:
from skimage.io import imread image = imread(image_path)
对于imresize:
from skimage.transform import resize resized_image = resize(image, (new_width, new_height))
对于imsave:
from skimage.io import imsave imsave(output_path, image)