老代码报错: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 ...
随机推荐
- APOLLO DEV环境列表无法显示解决,重启对应的Apollo服务
APOLLO DEV环境列表无法显示解决,重启对应的Apollo服务 找到项目中的apollo-core jar包中的配置文件,查看dev.meta的服务器配置IP:端口 apollo-env.pro ...
- kettle从入门到精通 第七十一课 ETL之kettle 再谈http post,轻松掌握body中传递json参数
场景: kettle中http post步骤如何发送http请求且传递body参数? 解决方案: http post步骤中直接设置Request entity field字段即可. 1.手边没有现成的 ...
- golang执行命令 && 实时获取输出结果
背景 golang可以获取命令执行的输出结果,但要执行完才能够获取. 如果执行的命令是ssh,我们要实时获取,并执行相应的操作呢? 示例 func main() { user := "roo ...
- 配置pod拉取harbor容器镜像仓库私有镜像:secret保存账号密码
目录 一.系统环境 二.前言 三.Docker-Registry类型的Secret简介 四.镜像仓库简介 五.搭建Harbor容器镜像仓库 5.1 安装Harbor 5.2 创建项目 5.3 推送镜像 ...
- 高通与At指令:AtCop解析
背景 在某个新基线上移植AT指令,发现有问题,因此收集了这个系列的 文章 作为 这方面的知识补充. 原文作者:laozhuxinlu,本文有删改. 另外,还参考了:https://www.cnblog ...
- ZYNQ Linux使用SPI驱动
--- title: ZYNQ Linux使用SPI驱动 EntryName: xilinx-zynq-using-spi-driver-in-linux date: 2020-10-14 10:02 ...
- [FLET] 01 可以拖动的方块
from typing import List import flet from flet import ( Container, Draggable, DragTarget, Page, Row, ...
- Nuxt3 的生命周期和钩子函数(十一)
title: Nuxt3 的生命周期和钩子函数(十一) date: 2024/7/5 updated: 2024/7/5 author: cmdragon excerpt: 摘要:本文详细介绍了Nux ...
- yb课堂 课程总结
- yb课堂实战之订单和播放记录事务控制 《十六》
开启事务控制 启动类:@EnableTransactionManagement 业务类,或者业务方法@Transactional 默认事务的隔离级别和传播属性 启动类上加注解 Service层加注解