在使用scipy.misc.imsave函数时出现了No module named ‘scipy.misc.imsave’ 的错误,现在的博客上大多解决办法都集中于:
Functions from scipy.interpolate (spleval, spline, splmake, and spltopp) and functions from scipy.misc (bytescale,
fromimage, imfilter, imread, imresize, imrotate, imsave, imshow, toimage) have been removed. The former set has
been deprecated since v0.19.0 and the latter has been deprecated since v1.0.0. Similarly, aliases from
scipy.misc (comb, factorial, factorial2, factorialk, logsumexp, pade, info, source, who) which have been
deprecated since v1.0.0 are removed. SciPy documentation for v1.1.0 can be used to track the new import locations
for the relocated functions.
scipy.misc (bytescale, fromimage, imfilter, imread, imresize, imrotate, imsave, imshow, toimage)这些函数已经被弃用了。
解决方法:
用其他函数来代替,比如imageio
['RETURN_BYTES', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__',
'__path__', '__spec__', '__version__', 'core', 'formats', 'get_reader', 'get_writer', 'help', 'imread', 'imsave',
'imwrite', 'mimread', 'mimsave', 'mimwrite', 'mvolread', 'mvolsave', 'mvolwrite', 'plugins', 'read', 'save',
'show_formats', 'volread', 'volsave', 'volwrite']
import imageio
imageio.imsave(fname, pil_img)