python代碼中導入imresize:
from scipy.misc import imresize
出現如下錯誤,無法導入:
ImportError: cannot import name 'imresize'
這是由於scipy版本問題導致的,在scipy 1.3.0之後的版本中將不再包含函數imresize:
imresize is deprecated! imresize is deprecated in SciPy 1.0.0, and will be removed in 1.3.0. Use Pillow instead: numpy.array(Image.fromarray(arr).resize()).
因此,爲了使用imresize,需要將scipy降到早期的版本:
pip3 install scipy==1.1.0
問題解決。