运行classify.py时报错 Mean shape incompatible with input shape
来源:互联网 发布:science杂志知乎 编辑:程序博客网 时间:2024/06/07 02:22
解决方法参考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.')
1 0
- 运行classify.py时报错 Mean shape incompatible with input shape
- Caffe: 运行classify.py时报错 Mean shape incompatible with input shape
- 运行classify.py时报错 Mean shape incompatible with input shape
- 运行classify.py时报错 Mean shape incompatible with input shape
- caffe运行出现Mean shape incompatible with input shape错误
- python调用caffe模型进行classify时读入mean文件错误:mean shape incompatible with input shape
- python调用caffe接口进行classify时提示Mean shape incompatible with input shape错误的解决方法
- python调用caffe接口进行classify时提示Mean shape incompatible with input shape错误的解决方法
- python调用caffe接口进行classify时提示Mean shape incompatible with input shape错误的解决方法
- 【边喝caffee边Caffe 】(二)python版本的报错:Mean shape incompatible with input shape
- WLI:There are running instances with incompatible serialization shape问题解决
- readOGR加载shape文件时报错
- shape
- Shape
- shape
- shape
- Shape
- shape
- 使用模板加快编码效率(一)——txt文本
- ubuntu+kali常见问题总结
- CSDN-markdown编辑器
- 设计模式初体验---简单工厂模式SimpleFactory
- Google官方统计Android版本分布
- 运行classify.py时报错 Mean shape incompatible with input shape
- 计算几何算法概览
- ZigBee协议栈的安装调试
- CentOS7 VM安装后无法上网
- Leetcode211 - Add and Search Word - Data structure design
- UML类图几种关系的总结
- Hadoop之——HDFS
- OC面试题1
- 欢迎使用CSDN-markdown编辑器