老代码报错: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 ctrl+c 复制不起作用
现象: 在edge中选中文字时,按一次ctrl+c,到其它程序ctrl+v,并不是你选中的内容. 需要在edge中按2次ctrl+c才行. --- 当你选中文字时,会出现一个三个点的菜单,点击后会出现 ...
- Mysql常见使用问题的解决方法
问题一:Mysql插入中文数据时,报错"incorrect string value"字符转换不正确 解决方法: 第一种方式: 1.更改Mysql安装目录下的文件my.ini(一般 ...
- JVM性能分析与故障排查
引言 JVM调优 程序在上线前的测试或运行中有时会出现一些大大小小的JVM问题,比如cpu load过高.请求延迟.tps降低等,甚至出现内存泄漏(每次垃圾收集使用的时间越来越长,垃圾收集频率越来越高 ...
- output打印ElasticSearch搜索条件searchSourceBuilder对象 toString方法
打印搜索条件:log.info(searchSourceBuilder.toString());log.info("es搜索条件:[{}]", searchSourceBuilde ...
- 随机二次元图片API第二弹
Tips:当你看到这个提示的时候,说明当前的文章是由原emlog博客系统搬迁至此的,文章发布时间已过于久远,编排和内容不一定完整,还请谅解` 随机二次元图片API第二弹 日期:2018-3-4 阿珏 ...
- Linux-swap管理
什么是Swap Swap:交换空间,即虚拟内存,用于解决内存不足的问题. 在内存不足的时候,会将内存中不常使用的部分存入硬盘,使得内存得以腾出空间供新的程序使用. 那么,虚拟内存即为硬盘中的部分. S ...
- 在 AWS 平台搭建 DolphinScheduler
AWS平台搭建 DolphinScheduler DolphinScheduler 是当前热门的调度器,提供了完善的可视化.拖拉拽式的调度.在 AWS 平台上提供了 airflow 与 step fu ...
- 使用Github Action来辅助项目管理
Github action 是一个Github官方提供的非常流行且速度集成 持续集成和持续交付(CI/CD)的工具.它允许你在GitHub仓库中自动化.定制和执行你的软件开发工作流.你可以发现.创建和 ...
- 【创龙全国产T3核心板】赋能工业领域新发展
在工业5.0时代浪潮持续推进并具备确定性的时代背景下,工业领域创新升级的需求日益增长,为满足各种工业环境下的应用需求,面向工业领域,创龙科技推出了基于全志T3处理器的元器件全国产化工业级核心板--SO ...
- NXP i.MX 6ULL工业开发板硬件说明书( ARM Cortex-A7,主频792MHz)
前 言 本文档主要介绍TLIMX6U-EVM评估板硬件接口资源以及设计注意事项等内容. 创龙科技TLIMX6U-EVM是一款基于NXP i.MX 6ULL的ARM Cortex-A7高性能低功耗处理 ...