Caffe
2015-05-29 16:46
337 查看
R-CNN detection
matlab路径问题
detector文件的修改
R-CNN detection
matlab路径问题
在运行官方提供的R-CNN实例时,当运行语句[code]../python/detect.py --crop_mode=selective_search --pretrained_model=../models/bvlc_reference_rcnn_ilsvrc13/bvlc_reference_rcnn_ilsvrc13.caffemodel --model_def=../models/bvlc_reference_rcnn_ilsvrc13/deploy.prototxt --gpu --raw_scale=255 _temp/det_input.txt _temp/det_output.h
时出现如下问题
[code]File "/usr/lib/python2.7/subprocess.py", line 710, in init errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory
按照步骤
1.运行demo.m (先安装linux版本的matlab)
2.将selective_search_ijcv_with_python加入python系统路径
ps:也可以使用 sys.path.append()
参照https://github.com/BVLC/caffe/issues/1030描述核对,也没发现问题,最后终于在https://groups.google.com/forum/#!topic/caffe-users/9bV9dqXhh0A
找到问题所在
[code]Desmond Elliott ...This error is because it cannot read a file that it expected to be produced by MATLAB. 1) Have you correctly set Matlab path in Makefile.config? 2) Have you built the MATLAB packages for Caffe? `make matcaffe`
原来是matlab路径找不到的原因,遂将matlab添加到系统路径就正常运行了.
[code]ps:添加路径可以在/etc/profile或~/.bashrc中添加 export PATH=$PATH:{path_you_want_to_add} 最后source file_name 立即生效 最好重启Ipyhon notebook不然path在环境下好像还没更新
detector文件的修改
处理完上面的问题接着运行后还可能会出现如下问题[code]predictions = out[self.outputs[0]].squeeze(axis=(2,3)) 87 88 # For oversampling, average predictions across crops. ValueError: 'axis' entry 2 is out of bounds [-2, 2)
依据https://github.com/BVLC/caffe/issues/2041
将出现问题的文件
detector.py和行数确定后做如下修改
将86行的
out[self.outputs[0]].squeeze(axis=(2,3))
修改为
predictions = out[self.outputs[0]].squeeze()
可以正常使用detector.py了,这样修改是否会有影响dgmp88也不清楚,但我在做detection的时候暂时没发现有什么影响,特此说明。
相关文章推荐
- bootStrap中Tab页签切换
- Philosophy is systematic reflective thinking on life.
- HTML5新增标签总结和说明
- JSP相对路径与绝对路径探秘
- 检测浏览器是否支持HTML5视频
- 轮播图定时器翻页-jQuery方法
- ExtJS 4.2 02 ExtJs 基础
- github上值得关注的前端项目
- jquery-javascrip(jsonp) 跨域
- Difference between menu item types; Display, Output and Action in Dynamics Ax
- jQuery里$(this)和this的区别在哪?
- JavaScript closure
- css属性使用记录
- JSON对象和字符串之间的相互转换
- jQuery异步表单提交
- js实现可兼容IE、FF、Chrome、Opera及Safari的音乐播放器
- SharePreferences的用法
- jQuery的preventDefault()
- angularjs初学之todoList练习
- angularjs 和 ionic 教程网址