不降低scipy版本解决AttributeError: module ‘scipy.misc‘ has no attribute ‘imresize‘问题
问题描述
在Tensorflow2.1.0上运行代码出现
AttributeError: module ‘scipy.misc’ has no attribute ‘imresize’
查阅资料大多都是降低scipy版本来解决问题,但是Tensorflow2.1.0需要scipy1.4.1版本,因此,降低scipy版本并不能够解决上述问题。
解决方法
from scipy import misc
img = misc.imread(image_path)
将上面的代码修改成为下面的形式即可。
from skimage.transform import resize
scaled_temp = resize(cropped_temp,output_shape=(image_size, image_size))
原因分析
新版本的Scipy和Pillow库已经弃用这些函数。
可查看 https://docs.scipy.org/doc/scipy-1.2.1/reference/generated/scipy.misc.imresize.html
参考:https://blog.csdn.net/qq_38835585/article/details/105489085
https://blog.csdn.net/qq_38835585/article/details/105489085
不降低scipy版本解决AttributeError: module ‘scipy.misc‘ has no attribute ‘imresize‘问题相关推荐
- 成功解决AttributeError: module ‘scipy.sparse‘ has no attribute ‘coo_array‘
成功解决AttributeError: module 'scipy.sparse' has no attribute 'coo_array' 目录 解决问题 解决思路 解决方法 T1.conda直接下 ...
- 解决AttributeError: module ‘matplotlib.mlab‘ has no attribute ‘normpdf‘
解决AttributeError: module 'matplotlib.mlab' has no attribute 'normpdf' 报错代码 y = mlab.normpdf(bins, mu ...
- 成功解决AttributeError: module tensorflow.sets has no attribute intersection
成功解决AttributeError: module tensorflow.sets has no attribute intersection 目录 解决问题 解决思路 解决方法 T1.更新 t ...
- 成功解决AttributeError: module tensorflow.image has no attribute resize
成功解决AttributeError: module tensorflow.image has no attribute resize 目录 解决问题 解决思路 解决方法 解决问题 Attribute ...
- 成功解决AttributeError: module ‘tornado.web‘ has no attribute ‘asynchronous‘
成功解决AttributeError: module 'tornado.web' has no attribute 'asynchronous' 目录 解决问题 解决思路 解决方法 解决问题 Attr ...
- 成功解决AttributeError: module tensorflow.compat has no attribute v1
成功解决AttributeError: module 'tensorflow.compat' has no attribute 'v1' 目录 解决问题 解决思路 解决方法 1.tf.Session ...
- 成功解决AttributeError: module 'torch.utils' has no attribute 'data'
成功解决AttributeError: module 'torch.utils' has no attribute 'data' 目录 解决问题 解决思路 解决方法 解决问题 AttributeErr ...
- 成功解决AttributeError: module 'cv2.cv2' has no attribute 'CV_CAP_PROP_FPS'和 'CV_CAP_PROP_FRAME_WIDTH'
成功解决AttributeError: module 'cv2.cv2' has no attribute 'CV_CAP_PROP_FPS'和 'CV_CAP_PROP_FRAME_WIDTH' 目 ...
- 成功解决AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d'
成功解决AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d' 目录 解决问题 解决思路 解决方法 解决问题 Attribute ...
最新文章
- linux下根据进程号PID查找程序路径
- iOS - 修改 UITextField 的 clearButtton 样式
- 用TLS实现安全TCP传输及配置和访问https的web服务(转)
- 【Servlet】Session的特点和使用
- 介绍一个国外的分类网站Egouz
- 关于一道数据库例题的解析。为什么σ age22 (πS_ID,SCORE (SC) ) 选项是错的?
- python实例 95,96
- CCF NOI1098 森林
- 为戴尔服务器下载ESXi
- mysql常用语句梳理
- 这台计算机无法连接usb,爱思助手无法连接或者连接超时解决办法
- Linux下Pulseaudio的可视化管理---pavucontrol
- 手机问卷调查报告 html,关于手机的问卷调查调研报告.doc
- 计算机组装需要注意什么东西,组装一台计算机需要注意那些问题?
- Sublime修改成为Python编辑器,设置系统环境变量
- Java中string字符串和char字符之间的千丝万缕
- shell 统计单词频率
- C语言学习(1)VScode配置C语言环境(超详细)
- React 官网为什么那么快?
- webapi Message已拒绝为此请求授权。/Message
热门文章
- Nat.Commun. | AI指导发现炎症性肠病保护治疗方法
- Windows10下安装配置 perl 环境
- 关于自注意力机制的思考
- 第三课.Linux代码编辑器
- 织梦怎么改网站主页php,无忧主机教你修改织梦DedeCms网站首页为动态显示的方法...
- html中全选按钮代码怎么写,html中的javascript 全选/取消全选操作示例代码
- 诚聘英才,共创未来!华南农业大学农学院高层次人才招聘
- Cell Reports:中大骆观正+上科大季泉江-CRISPR引导的细菌靶向遗传筛选系统
- 结果方程模型(SEM)的理论和基本实现过程
- Nature Genetics:微生物如何适应植物的?