老代码报错:scipy.misc.imresize报错: AttributeError: module 'scipy.misc' has no attribute 'imresize'
运行老代码报错:
image = misc.imresize(image, [Config.IMAGE_HEIGHT, Config.IMAGE_WIDTH], 'bilinear')
AttributeError: module 'scipy.misc' has no attribute 'imresize'

===============================================
解决方案:

# import scipy.misc as misc
from PIL import Image
------------------------------------------

# image = misc.imresize(image, [Config.IMAGE_HEIGHT, Config.IMAGE_WIDTH], 'bilinear')
image = np.asarray(Image.fromarray(image).resize([Config.IMAGE_HEIGHT, Config.IMAGE_WIDTH], Image.Resampling.BILINEAR))
=======================================
老代码报错:scipy.misc.imresize报错: AttributeError: module 'scipy.misc' has no attribute 'imresize'的更多相关文章
- AttributeError: module 'scipy.misc' has no attribute 'imread'
运行python程序报错:AttributeError: module 'scipy.misc' has no attribute 'imread' 报错原因1:scipy版本过高 解决方案:降低sc ...
- ansible报错AttributeError: module 'urllib.request' has no attribute 'HTTPSHandler'
报错内容: TASK [activemq : extract activemq tarball] *************************************************** ...
- 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.imw ...
- Python报错module 'scipy.misc' has no attribute 'xxx'
Python报错module 'scipy.misc' has no attribute 'imresize' 解决办法: 安装Pillow包,命令如下: pip install Pillow 然后重 ...
- 完美解决 scipy.misc.imread 报错 TypeError: Image data cannot be converted to float
File "/home/harrison/anaconda3/lib/python3.7/site-packages/matplotlib/image.py", line 634, ...
- eclipse 中 import sun.misc.BASE64Decoder; 报错
from://http://blog.sina.com.cn/s/blog_48964b120101ahrf.html 在android做3DES加密功能时 eclipse 中 import sun. ...
- asp.net textbox等服务器控件包含html代码的时候,提交会报错
asp.net textbox等服务器控件包含html代码的时候,提交会报错,页面中的其他按钮点击的时候也会报错误, 解决方法: Page里加上这个属性 ValidateRequest=" ...
- php项目代码 编码格式不对会大范围报错
php项目代码 编码格式不对会大范围报错
- ASP.NET MVC 复制MVC项目代码到同一个项目的时候报错The request for ‘home’ has found the following matching controll
ASP.NET MVC 复制MVC项目代码到同一个项目的时候报错The request for ‘home’ has found the following matching controll “/” ...
- python代码在linux终端中执行报错:Unable to init server: Could not connect: Connection refused
python代码在linux终端中执行时报错: Unable to init server: Could not connect: Connection refused Unable to init ...
随机推荐
- edge 书签栏 收藏夹栏 字体大小
WIN10中,edge收藏夹栏字体太大,如果收藏数目多,得多翻好几页. 解决方法: 地址栏中输入: edge://flags/#edge-pc-ui-integration Enable Window ...
- 5 分钟小工具:使用 dive 分析 docker 镜像
需求 拿到一个镜像之后,我想知道: 分层查看镜像里都有哪些文件 各层使用了什么命令构建的这个镜像 镜像里比较大的文件有哪些(可能需要优化) dive 工具介绍 dive 工具可以做这些分析.dive ...
- 请写出常用的linux指令
a.cd /home 进入 '/ home' 目录' b.cd .. 返回上一级目录 c.cd ../.. 返回上两级目录 d.mkdir dir1 创建一个叫做 'dir1' 的目录' e.mkdi ...
- XAF 属性编辑器(PropertyEditor)- 原理篇
前言 随着 DEV24.1.3 的发布,XAF Blazor 中的属性编辑器(PropertyEditor)也进行了很大的改动,在使用体验上也更接近 WinForm 了,由于进行了大量的封装,理解上没 ...
- 认真学习css3--01-全是日志没有技术内容
由于某些原因,还是要写写前端代码. 虽然这不是我的主要责任,但也有表率的必要性. css3这个东西没有什么大难度,难点主要集中在: 1)样式比较多 2)精准定位 3)性能优化 其中第2个是日常经常面对 ...
- Java面试知识点(四)重写和重载
重写override 在 java 中有很多的继承,继承下来的有变量.方法.在有一些子类要实现的方法中,方法名.传的参数.返回值跟父类中的方法一样,但具体实现又跟父类的不一样,这时候我们就需要重写父类 ...
- 记一次难忘的json反序列化问题排查经历
前言 最近我在做知识星球中的商品秒杀系统,昨天遇到了一个诡异的json反序列化问题,感觉挺有意思的,现在拿出来跟大家一起分享一下,希望对你会有所帮助. 案发现场 我最近在做知识星球中的商品秒杀系统,写 ...
- 继续我们的复习之路——webapi
前面断更几天是因为在住安心复习DOM BOM的内容 不得不说 还得是DOM 在这一章节的复习内容中 涌现出了很多又代表意义 经典的一些小案例 而且 还是有些难度的 有一两个我反正是自己独立完成不了 ...
- mac idea 配置Tomcat
官网下载Tomcat 下载地址:点我直达 配置Idea 设置Application Servers 操作步骤:Intellij IDEA->Preferences->Application ...
- [oeasy]python0133_[趣味拓展]颜文字_流石兄弟_表情文字_2ch_kaomoji
颜文字 回忆上次内容 上次我们了解unicode 里面有各种字体 甚至还有emoji emoji 本质上也是文字 按照unicode的方式编码 存储时按照utf-8的方式编码 显示时按照系统定义的 ...