Tensorflow机器学习入门——AttributeError: module 'scipy.misc' has no attribute 'toimage'


这个bug的解决办法:

import cv2
# scipy.misc.toimage(image_array).save('cifar10_data/raw/%d.jpg' % i)
cv2.imwrite('cifar10_data/raw/%d.jpg' % i,image_array)

用  cv2.imwrite  代替   scipy.misc.toimage 

如果没有安装cv2 ,请用如下命令安装:pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple/

网上还有一种办法是降低sicpy的版本,个人觉得太麻烦,没试过。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM