老代码报错: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 ...
随机推荐
- C#.NET 国密 SM2 公钥证书从文本转换
先前的 Util 是直接从文件中转换的 https://www.cnblogs.com/runliuv/p/15079404.html public static AsymmetricKeyParam ...
- .NET5 IIS ASP.NET CORE 部署时 HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure
.NET5 IIS ASP.NET CORE 部署时 HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure 部署机器只安装了dotnet-hos ...
- Kubernetes监控手册03-宿主监控实操
生产环境大都是在 Linux 下的,所以这篇文章我们先来分享如何使用 Categraf 采集 Linux OS 相关的指标.读完本篇内容,你应该可以完成机器层面的监控了. 原理概述 Categraf ...
- Vue学习:22.Vue组件库-Vant
Vue组件库是一系列预先构建好的.可复用的UI组件集合,它们设计用于加速Vue.js应用程序的开发过程.这些组件通常遵循一定的设计规范,提供统一的外观和交互体验,让开发者能够快速搭建用户界面. 组件库 ...
- html 适配iphone X 底部导航
html 适配iphone X 底部导航 适配手机底部有横线的手机,以免被横线遮挡 padding-bottom: constant(safe-area-inset-bottom); /* 兼容 iO ...
- ELKF(elasticsearch、logstash、kibana、filebeat)搭建及收集nginx日志
1.elasticsearch 1.1.根目录下新建data文件夹 1.2.修改elasticsearch.yml文件,添加以下内容 path.data: /home/wwq/elk/elastics ...
- P9482 [NOI2023] 字符串
\(36pts\) \(O(tqn^2)\)暴力即可 \(40pts\) 对于最朴素的暴力优化,从头到尾扫,如果已经当前位字符比出优先级,那么直接能判断了,没必要往后跑了,第15个性质B的也给跑过了, ...
- Java中的泛型(类、接口、方法)
一.泛型概述 1. 什么是泛型? 泛型,即"参数化类型".一提到参数,最熟悉的就是定义方法时有形参列表,普通方法的形参列表中,每个形参的数据类型是确定的,而变量是一个参数.在调用普 ...
- 推荐常用的Idea插件
Idea常用快捷键 删除所有空行 使用替换 Ctrl + R 点亮后面的魔法图标启用正则表达式,输入:^\s*\n,然后选择替换全部 查询指定类或方法在哪里被引用 光标点中需要查找的类名和方法名,然后 ...
- Nuxt框架中内置组件详解及使用指南(三)
title: Nuxt框架中内置组件详解及使用指南(三) date: 2024/7/8 updated: 2024/7/8 author: cmdragon excerpt: 摘要:"Nux ...