老代码报错: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 ...
随机推荐
- 发现XWPFDocument写入Word文档时的小BUG:两天的探索与解决之旅
引言 最近在使用XWPFDocument生成Word文档时,遇到一个错误:"未将对象引用设置到对象的实例".这个平常很容易找到原因的问题却困扰了我两天,最终发现问题出在设置段落时赋 ...
- MyBatis 关于查询语句上配置的详细内容
1. MyBatis 关于查询语句上配置的详细内容 @ 目录 1. MyBatis 关于查询语句上配置的详细内容 2. 准备工作 3. SQL查询结果,返回为POJO实体类型 4. SQL查询结果,返 ...
- 使用 nginx 共享文件
1. 安装nginx 2. 在nginx的配置文件的server部分加上如下的配置: location /shared/ { autoindex on; autoindex_exact_size on ...
- ClickHouse介绍(三)MergeTree系列表引擎
MergeTree系列表引擎 ClickHouse中最核心的引擎当属MergeTree系列引擎,其中基础表引擎为MergeTree,常用的表引擎还有ReplacingMergeTree.Summing ...
- Windows 编译 FFMpeg
Windows 编译 FFMpeg 背景: 为了提高公司产品的质量,对FFMPEG进行优化,需要重新编译. Host :Windows-10,core-i7 MinGW :网络版 pkg-config ...
- 使用kk在centos7上离线部署kubesphere v3.0.0详解
环境准备 以三台centos 7.7 64bit 为例: 确保所有机器已经安装所需依赖软件(sudo curl openssl ebtables socat ipset conntrack docke ...
- EC热键问题
EC热键问题 ec 问题描述 ACPI事件监控 按键监控 UDEV事件监控 kprobe探测 初步总结热键功能流程 调试记录 PS2 问题描述 系统无触摸板打开和关闭的提示 已知热键功能 快捷键 功能 ...
- vulnhub - hackme1
vulnhub - hackme1 信息收集 端口扫描 详细扫描 目录扫描跟漏洞探测没发现什么可用信息,除了登录还有一个uploads目录应该是进入后台之后才能使用 web主页是个登录注册页面,爆了一 ...
- Java集合框架总结图
Collection 接口的接口(对象集合) ├---List 接口:元素都有索引,可以重复,有序(迭代器顺序). │------├ LinkedList 接口实现类, 双向链表, 查询慢,增删快,效 ...
- 松灵机器人scout mini小车 自主导航(1)
松灵机器人scout mini小车 自主导航 最近实验室来了个松灵机器人scout mini的底座.本着学习的目的对其进行了研究,从最基础的连接开始. 1.硬件连接准备 松灵scout mini提供了 ...