这个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的版本,个人觉得太麻烦,没试过。

Tensorflow机器学习入门——AttributeError: module 'scipy.misc' has no attribute 'toimage'的更多相关文章

  1. AttributeError: module 'scipy.misc' has no attribute 'imread'

    运行python程序报错:AttributeError: module 'scipy.misc' has no attribute 'imread' 报错原因1:scipy版本过高 解决方案:降低sc ...

  2. module 'scipy.misc' has no attribute 'toimage',python

    anaconda环境下: 错误:python 命令行运行出错:module 'scipy.misc' has no attribute 'toimage' 解决:打开Anaconda prompt,输 ...

  3. Python报错module 'scipy.misc' has no attribute 'xxx'

    Python报错module 'scipy.misc' has no attribute 'imresize' 解决办法: 安装Pillow包,命令如下: pip install Pillow 然后重 ...

  4. Python报错——module 'scipy.misc' has no attribute 'imresize'

    报错是因为要安装PIL库,库名现在为Pillow,在命令行上安装即可: pip3 install Pillow

  5. ansible报错AttributeError: module 'urllib.request' has no attribute 'HTTPSHandler'

    报错内容: TASK [activemq : extract activemq tarball] *************************************************** ...

  6. Tensorflow机器学习入门——ModuleNotFoundError: No module named 'tensorflow.keras'

    这个bug的解决办法: # from tensorflow.keras import datasets, layers, models from tensorflow.python.keras imp ...

  7. Tensorflow机器学习入门——MINIST数据集识别

    参考网站:http://www.tensorfly.cn/tfdoc/tutorials/mnist_beginners.html #自动下载并加载数据 from tensorflow.example ...

  8. Tensorflow机器学习入门——读取数据

    TensorFlow 中可以通过三种方式读取数据: 一.通过feed_dict传递数据: input1 = tf.placeholder(tf.float32) input2 = tf.placeho ...

  9. Tensorflow机器学习入门——常量、变量、placeholder和基本运算

    一.这里列出了tensorflow的一些基本函数,比较全面:https://blog.csdn.net/M_Z_G_Y/article/details/80523834 二.这里是tensortflo ...

随机推荐

  1. android底部导航栏实现

    第一种用radiobutton实现 https://wizardforcel.gitbooks.io/w3school-android/content/75.html 布局文件,使用radiogrou ...

  2. DP_1d1d诗人小G

    显然:f[i]=min{f[j]+(s[i]-s[j]+i-j-1-l)^p} 此题可以基于决策单调优化 证明,反正我现在不打算学 实际上就是双向队列 不停弹出队头的元素,直到当前位置在队头元素最优的 ...

  3. Linux - 命令 - 查找命令总结

    关于查找文件的几个命令 一.find命令 find是最常用也是最强大的查找命令,可以查找任何类型的文件 find命令的一般格式: find <指定目录><指定条件><指定 ...

  4. bugku 域名解析题 50

    什么是域名解析???? 首先我们在Windows上找到文件“C:\Windows\System32\drivers\etc\hosts” 然后找到host 双击用记事本打开然后填写上黄色区域上的东西 ...

  5. expect 脚本

    实现远程执行 /home/dataexa/test/proxy.expect touch proxy.expect #!/usr/bin/expect set timeout 30 spawn ssh ...

  6. MVVM架构的理解

    摘自维基百科 MVVM(Model–view–viewmodel)是一种软件架构模式. MVVM有助于将图形用户界面的开发与业务逻辑或后端逻辑(数据模型)的开发分离开来,这是通过置标语言或GUI代码实 ...

  7. mtrace 简介

    内存泄露问题一般会再长时间运行的程序中暴露出来.而且一般很难定位和查找. linux 提供mtrace/muntrace来检测程序是否有内存泄露.一般来说要检测哪一段代码是否有内存泄露,就可以用这一对 ...

  8. Spring错误:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.Bi

    在使用SSM框架传递多个参数的时候发生如下错误: 原因是因为在传递多个参数的时候没有使用注解@Param,所以才包如下错误: 参考的技术文章:https://blog.csdn.net/sinat_2 ...

  9. ARM64架构下登录mysql出错:mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file:

    Linux下登录mysql出错:mysql: error while loading shared libraries: libncurses.so.5: cannot open shared obj ...

  10. Flex布局如何实现最后一个元素右对齐(CSS)

    在最后一项元素使用样式: margin-left: auto;