运行老代码报错:

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'的更多相关文章

  1. AttributeError: module 'scipy.misc' has no attribute 'imread'

    运行python程序报错:AttributeError: module 'scipy.misc' has no attribute 'imread' 报错原因1:scipy版本过高 解决方案:降低sc ...

  2. ansible报错AttributeError: module 'urllib.request' has no attribute 'HTTPSHandler'

    报错内容: TASK [activemq : extract activemq tarball] *************************************************** ...

  3. 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 ...

  4. Python报错module 'scipy.misc' has no attribute 'xxx'

    Python报错module 'scipy.misc' has no attribute 'imresize' 解决办法: 安装Pillow包,命令如下: pip install Pillow 然后重 ...

  5. 完美解决 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, ...

  6. eclipse 中 import sun.misc.BASE64Decoder; 报错

    from://http://blog.sina.com.cn/s/blog_48964b120101ahrf.html 在android做3DES加密功能时 eclipse 中 import sun. ...

  7. asp.net textbox等服务器控件包含html代码的时候,提交会报错

    asp.net  textbox等服务器控件包含html代码的时候,提交会报错,页面中的其他按钮点击的时候也会报错误, 解决方法: Page里加上这个属性 ValidateRequest=" ...

  8. php项目代码 编码格式不对会大范围报错

    php项目代码 编码格式不对会大范围报错

  9. 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 “/” ...

  10. 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 ...

随机推荐

  1. 微信刷脸SDK获取sub_openid

    当调用SDK中 获取用户信息(getWxpayfaceUserInfo) /人脸支付凭证(getWxpayfaceCode) 方法获取 sub_openid 时,除了SDK自身要传入sub_appid ...

  2. asp.net中gridview隐藏一列并且使用这列数据的方法

    方法一:在RowCreated事件中添加如下代码可隐藏此列,使用this.grdView.Rows[index].Cells[1].Text获取值,index为行号. 1 protected void ...

  3. Centos7部署FytSoa项目至Docker——第二步:安装Mysql、Redis

    FytSoa项目地址:https://gitee.com/feiyit/FytSoaCms 部署完成地址:http://82.156.127.60:8001/ 先到腾讯云申请一年的云服务器,我买的是一 ...

  4. lovelive - μ's

    Tips:当你看到这个提示的时候,说明当前的文章是由原emlog博客系统搬迁至此的,文章发布时间已过于久远,编排和内容不一定完整,还请谅解` lovelive - μ's 日期:2017-12-16 ...

  5. python 二次封装logging,导致日志输出的filename错误及优化封装

    问题 封装logging文件名称为:A.py 调用A模块的文件名称为:B.py 二次封装了logging日志模块,根据需要,传入level,判断等级,调用logging模块的info.debug等日志 ...

  6. 天翼云安装nexus3.37.1

    有点操蛋,官网网络太慢了! 百度了不少网友的内容,综合如下 总体是个皮毛,但已经可以用于开发了! 一.下载和安装 https://download.sonatype.com/nexus/3/nexus ...

  7. Windows无法调节亮度

    原因1:驱动问题 解决方式: 安装360驱动大师,一键安装. 也可以使用其他软件:如驱动精灵. 推荐使用电脑品牌本身的驱动软件:如联想:联想驱动管理 原因2:设备管理问题 解决方式: 计算机 -> ...

  8. 题解:洛谷 P1137 旅行计划

    标签:图论,拓扑,dp 题意 给定一张 \(n\) 个点 \(m\) 条边的 DAG,对于每个 \(i\),求以它为终点最多经过多少个点? 思路 由于是 DAG,求的是终点 \(i\) 经过的所有点, ...

  9. Linux Redis 服务设置开机自启动

    @ 目录 前言 一.准备工作 二.操作步骤 2.1 修改redis.conf文件 2.2 创建启动脚本 2.3 设置redis 脚本权限 2.4 设置开机启动 2.5 验证 总结 前言 请各大网友尊重 ...

  10. 【论文阅读】ICML2020: Can Autonomous Vehicles Identify, Recover From, and Adapt to Distribution Shifts?

    Column: January 6, 2022 7:18 PM Last edited time: January 30, 2022 12:14 AM Sensor/组织: Oxford Status ...