运行老代码报错:

image = misc.imresize(image, [Config.IMAGE_HEIGHT, Config.IMAGE_WIDTH], 'bilinear')
AttributeError: module 'scipy.misc' has no attribute 'imresize'

 

老代码报错:scipy.misc.imresize报错: AttributeError: module

 

 

===============================================

 

 

 

解决方案:

 

老代码报错:scipy.misc.imresize报错: AttributeError: module

 

# import scipy.misc as misc
from PIL import Image

 

 

 

------------------------------------------

 

 

 

老代码报错:scipy.misc.imresize报错: AttributeError: module

 

 

# image = misc.imresize(image, [Config.IMAGE_HEIGHT, Config.IMAGE_WIDTH], 'bilinear')
image = np.asarray(Image.fromarray(image).resize([Config.IMAGE_HEIGHT, Config.IMAGE_WIDTH], Image.Resampling.BILINEAR))

 

 

=======================================