这个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. 关于AutoCompleteTextView的用法:根据输入的自动匹配关键词

  2. C++ string类的使用

    C++ string的使用 在了解如何使用string类之前,我们先来看看C语言中使用字符串有多麻烦: 调用头文件:cstring 定义一个C字符串: char str1[51]="Hell ...

  3. iOS性能优化之内存(memory)优化

    https://www.jianshu.com/p/8662b2efbb23 近期在工作中,对APP进行了内存占用优化,减少了不少内存占用,在此将经验进行总结和分享,也欢迎大家进行交流. 在优化的过程 ...

  4. laravel 事件系统

    例子: 打开 VerificationController ,此控制器处理所有邮件认证相关逻辑: app/Http/Controllers/Auth/VerificationController.ph ...

  5. 《如何增加资本约见》---创业学习---训练营第四课---HHR---

    一,开始 1,思考题: (1)一句话和安利文两份材料怎么准备? (2)接触资本的渠道有哪些? 二,一句话介绍: 1,优秀案列: (1)通过第一视角,服务某某行业的智能AR眼镜: (2)成立三个月GMV ...

  6. Bugku-CTF加密篇之告诉你个秘密(ISCCCTF)

    告诉你个秘密(ISCCCTF)   636A56355279427363446C4A49454A7154534230526D6843 56445A31614342354E326C4B4946467A5 ...

  7. OGG在windows环境下字符集的配置

    windows环境下不配置字符集(默认使用windows自己的字符集),从linux等系统同步过来的表中如果含有中文字符列将显示为乱码,被ogg误认为虚拟列,从而导致进程abend. 设置ogg进程在 ...

  8. 11: Django + gunicorn + Nginx 的生产环境部署

    1.1 gunicorn介绍   1.Gunicorn 1. Gunicorn是使用Python实现的WSGI服务器, 直接提供了http服务, 并且在woker上提供了多种选择, gevent, e ...

  9. JupyterLab远程访问配置方法(CentOS7)

    下载 Anaconda3安装包,并执行安装命令: bash Anaconda3-2019.07-Linux-x86_64.sh 确定安装并初始化: Do you wish the installer ...

  10. ASP.NET CORE 基础知识(一):概述【上】

    此为系列文章,对MSDN ASP.NET Core 的官方文档进行系统学习与翻译.其中或许会添加本人对 ASP.NET Core 的浅显理解 原文请参考MSDN ASP.NET Core. 这篇文章是 ...