Fork me on CSDN

AttributeError: module 'scipy.misc' has no attribute 'imsave'

源代码:

def save_img(img, fname):
    pil_img = deprocess_image(np.copy(img))
    scipy.misc.imsave(fname, pil_img)

出现的问题(版本原因):

 

 修改代码:

#安装新版本API
pip install imageio
def save_img(img, fname):
    pil_img = deprocess_image(np.copy(img))
    imageio.imwrite(fname, pil_img)

 

posted @ 2021-07-22 19:07  追风赶月的少年  阅读(1032)  评论(0编辑  收藏  举报