【边喝caffee边Caffe 】(二)python版本的报错:Mean shape incompatible with input shape
在运行Ubuntu上的python版本,希望对比一下C++的结果是否正确时,发现一直报错Mean shape incompatible with input shape
后来遍查网络,发现了一个解决方法,见
http://blog.csdn.net/gzljss/article/details/45849013
直接贴过来
------------------------------------------分割线-----------------------------------------
解决方法参考http://stackoverflow.com/questions/29842935/mean-shape-incompatible-with-input-shape-caffe-classification-error-in-io-py
在运行caffe的python例子时,命令行输入
- python classify.py cat.jpg foo
报错
ValueError: Mean shape incompatible with input shape.
原因是‘mean’与‘input’的尺寸不同造成的。
参考前面的文章,修改了 ./python/caffe/io.py 文件
将:
- if ms != self.inputs[in_][1:]:
- raise ValueError('Mean shape incompatible with input shape.')
修改为:
- if ms != self.inputs[in_][1:]:
- print(self.inputs[in_])
- in_shape = self.inputs[in_][1:]
- m_min, m_max = mean.min(), mean.max()
- normal_mean = (mean - m_min) / (m_max - m_min)
- mean = resize_image(normal_mean.transpose((1,2,0)),
- in_shape[1:]).transpose((2,0,1)) * \
- (m_max - m_min) + m_min
- #raise ValueError('Mean shape incompatible with input shape.')
【边喝caffee边Caffe 】(二)python版本的报错:Mean shape incompatible with input shape相关推荐
- python报错ValueError: Must pass 2-d input. shape=(5, 1, 10)解决方案
1.承接上一篇博文,上文提到append()函数中的参数ignore_index=True,如果加上该参数,是a.append(b,ignore_index=True),数据不支持的情况下会报错&qu ...
- python安装报错类型_解决Python安装cryptography报错问题
解决Python安装cryptography报错问题 错误一: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wst ...
- python 读取文件报错:UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xb5 in position 0: invalid start
python 读取文件报错:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb5 in position 0: invalid start ...
- python 安装 pyinstaller 报错Preparing wheel metadata ... error
python 安装 pyinstaller 报错Preparing wheel metadata ... error ERROR: Command errored out with exit stat ...
- python 连接mysql报错:mysql.connector.errors.NotSupportedError: Authentication plugin ‘caching_sha2_passw
python 连接mysql报错:mysql.connector.errors.NotSupportedError: Authentication plugin 'caching_sha2_passw ...
- python运行启动报错解决方法_解决python运行启动报错问题
解决python运行启动报错问题 问题一: python启动报错api-ms-win-crt-process-l1-1-0.dll丢失 解决: 下载api-ms-win-crt-process-l1- ...
- 夜神模拟器打开后报错:nox_adb.exe已停止工作,Appium+Python脚本执行报错:500
一.场景回溯: 夜神模拟器打开后报错:nox_adb.exe已停止工作,Appium+Python脚本执行报错:500. 二.问题解决: 1.cmd中关闭Appium服务: 2.进入夜神模拟器安装的b ...
- This version of ChromeDriver only supports Chrome version 92 爬虫模拟浏览器点击时出现google插件版本问题报错
爬虫模拟浏览器点击时出现google插件版本问题报错,这个情况的话是由于本地存储的谷歌浏览器的驱动程序不对,需要更新,具体解决操作如下: 解决方法: 打开以下网址,下载对应版本的chromedrive ...
- Doris 5 python prepare_datastack.py 报错 xml.etree.ElementTree.ParseError: mismatched tag: line 10
Doris 5 python prepare_datastack.py 报错 xml.etree.ElementTree.ParseError: mismatched tag: line 10, co ...
- python读取表格报错:xlrd.biffh.XLRDError:Excel xlsx file;not support
python读取表格报错 当你间歇性踌躇满志的打开pycharm,看了一篇python+unittest+request接口自动化测试框架,你觉得有必要站在巨人的肩膀上眺望一下远方,于是你按步骤走到了 ...
最新文章
- 笔记 | 吴恩达Coursera Deep Learning学习笔记
- 160个Crackme041之无源码修改Delphi程序
- 微信开发 网页授权获取用户基本信息
- 《C++ Primer》13.1.1节练习
- tableau地图城市数据_举个栗子!Tableau 技巧(156):在地图分析中创建缓冲区
- REST测试工具之curl(URL多参数)
- 移动端——论使用图片撑出模拟背景所带来的好处(主要解决图片之上是一些动态变化的内容,图片的效果难以使用程序来实现)...
- 计算机系统集成项目工程师报名,2021年系统集成项目管理工程师报名流程
- iOS打包Framework
- Neon Love(霓虹爱)
- 计算机控制面板设置密码,如何设置修改电脑的开机密码
- 企业绩效管理的五种方法,你们是哪种?
- 计算机管理 存储空间不足,Win7系统提示“存储空间不足,无法处理此命令”怎么办?...
- 2022年漏洞事件盘点
- 计算机一级rank函数排名怎么用,排序函数(怎样用rank函数排名)
- 数加平台在数据挖掘项目中的实践 1
- 《数据库系统概论》课程指南
- teradata 查看 表定义_Teradata表类型
- Linux中的lo回环接口
- UE4虚幻引擎 LiveLink Face连接不上的问题