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的版本,个人觉得太麻烦,没试过。
Tensorflow机器学习入门——AttributeError: module 'scipy.misc' has no attribute 'toimage'的更多相关文章
- AttributeError: module 'scipy.misc' has no attribute 'imread'
运行python程序报错:AttributeError: module 'scipy.misc' has no attribute 'imread' 报错原因1:scipy版本过高 解决方案:降低sc ...
- module 'scipy.misc' has no attribute 'toimage',python
anaconda环境下: 错误:python 命令行运行出错:module 'scipy.misc' has no attribute 'toimage' 解决:打开Anaconda prompt,输 ...
- Python报错module 'scipy.misc' has no attribute 'xxx'
Python报错module 'scipy.misc' has no attribute 'imresize' 解决办法: 安装Pillow包,命令如下: pip install Pillow 然后重 ...
- Python报错——module 'scipy.misc' has no attribute 'imresize'
报错是因为要安装PIL库,库名现在为Pillow,在命令行上安装即可: pip3 install Pillow
- ansible报错AttributeError: module 'urllib.request' has no attribute 'HTTPSHandler'
报错内容: TASK [activemq : extract activemq tarball] *************************************************** ...
- Tensorflow机器学习入门——ModuleNotFoundError: No module named 'tensorflow.keras'
这个bug的解决办法: # from tensorflow.keras import datasets, layers, models from tensorflow.python.keras imp ...
- Tensorflow机器学习入门——MINIST数据集识别
参考网站:http://www.tensorfly.cn/tfdoc/tutorials/mnist_beginners.html #自动下载并加载数据 from tensorflow.example ...
- Tensorflow机器学习入门——读取数据
TensorFlow 中可以通过三种方式读取数据: 一.通过feed_dict传递数据: input1 = tf.placeholder(tf.float32) input2 = tf.placeho ...
- Tensorflow机器学习入门——常量、变量、placeholder和基本运算
一.这里列出了tensorflow的一些基本函数,比较全面:https://blog.csdn.net/M_Z_G_Y/article/details/80523834 二.这里是tensortflo ...
随机推荐
- 「题解」「CF468D」树中的配对
目录 题目大意 思路 源代码 本博客除代码之外,来自 skylee 大佬. 题目大意 一棵\(n(n\le10^5)\)个编号为\(1\sim n\)的点的带边权的树,求一个排列\(p_{1\sim ...
- pikachu平台搭建
1.将pikachu转移至htdocs 2.然后打开pikachu文件夹里的inc文件夹 3.里面对应的内容该成之前刚刚设置好的数据库服务器地址,用户名,密码和端口号 4.打开浏览器,输入http:/ ...
- Educational Codeforces Round 76 (Rated for Div. 2) A. Two Rival Students
You are the gym teacher in the school. There are nn students in the row. And there are two rivalling ...
- Python 特殊列表操作记录
1.列表中的NaN数据处理 由于在Excel中筛选数据时,会出现NaN这种数据,所以需要将其删除掉,处理函数如下: 由于NaN数据类型与其他数据类型不一样,所以需要需要根据类型将其去除掉. 2列表关于 ...
- 寒假安卓app开发学习记录(1)
今天是安卓软件开发的第一天.虽然之前有了对javaweb的学习,但是对基于安卓的软件开发还是一无所知.所以,第一步就是寻找学习资源,从慕课网上还有菜鸟教程上都找到了对应的教程.然后就开始了开发的第一步 ...
- GIL/Copy/私有/面向对象
1. GIL Python语言和GIL没有关系.仅仅是由于历史原因在Cpython虚拟机(解释器),难以移除GIL. GIL:全局解释器锁.每个线程在执行的过程都需要先获取GIL,保证同一时刻只有一个 ...
- jquery 获取 父级 iframe 里的控件对象
window.parent.document.getElementsByTagName('iframe')[0].contentWindow.document.getElementById('id')
- python 中对list去重
本文去重的前提是要保证顺序不变,本文给出了多种实现方法,需要的朋友可以参考下 1.直观方法 最简单的思路就是: ids = [1,2,3,3,4,2,3,4,5,6,1] news_ids = [] ...
- JS高级---构造函数通过原型添加方法,原型的作用: 共享数据, 节省内存空间
JS高级---构造函数,通过原型添加方法,原型的作用: 共享数据, 节省内存空间 构造函数 //构造函数 function Person(sex, age) { this.sex = sex; thi ...
- 【C语言】极坐标转换为直角坐标
写一个程序把极坐标(r,θ) (θ之单位为度)转换为直角坐标( X,Y). 转换公式是x=r.cosθ y=r.sinθ 程序输出:输出转换后的坐标. 弧度和角度的换算关系如下: 1弧度=180/π度 ...