做暖网站,网站项目的工作流程,网站嵌入视频代码,wordpress知识付费运行caffe官方提供的jupyter 的rcnn detection#xff0c;总是出现各种问题。先将问题及方法汇集在此#xff1a; 1. Selective Search 的安装问题 按照官网#xff0c;我下载了selective_search_ijcv_with_python#xff0c;但是在我的linux matlab2017a上总是出现问题总是出现各种问题。先将问题及方法汇集在此 1. Selective Search 的安装问题 按照官网我下载了selective_search_ijcv_with_python但是在我的linux matlab2017a上总是出现问题
Error using CountVisualWordsIndex (line 21)
First two input arguments should have the same 2D dimensionError in BlobStructColourHistError in Image2HierarchicalGrouping (line 42)
[colourHist blobSizes] BlobStructColourHist(blobIndIm, colourIm);Error in demo (line 61)
[boxes blobIndIm blobBoxes hierarchy]
Image2HierarchicalGrouping(im, sigma, k, minSize, colorType,
simFunctionHandles);
于是我谷歌到了https://github.com/nightrome/matconvnet-calvin/issues/18按照nightrome的方法下载新的版本将其与官网合并形成了最新的版本见链接: https://pan.baidu.com/s/1bSoJim 密码: 67rk在matlab中使用demo可以顺利运行。 2. 使用caffe运行python/detect.py 报错信息OSError: [Errno 2] No such file or directory
修改文件~/caffe-master/python/selective_search_ijcv_with_python/selective_search.py 修改前mc “matlab -nojvm -r \”try; {}; catch; exit; end; exit\”“.format(command) 修改后mc “/usr/local/MATLAB/R2014a/bin/matlab -nojvm -r \”try; {}; catch; exit; end; exit\”“.format(command) 3. 继续出错 TypeError: slice indices must be integers or None or have an index method
主要原因是我安装的caffe时使用了默认的anaconda安装的numpy1.13,应该降级使用1.11,参考https://github.com/rbgirshick/py-faster-rcnn/issues/480但是当我降级后caffe不能用了因此只能按照如下方法修改
将140行前面加上 windowwindow.astype(np.int64) 即改为 # Crop window from the image.windowwindow.astype(np.int64)crop im[window[0]:window[2], window[1]:window[3]]
将175-179改成 boxbox.astype(np.int64)context_crop im[box[0]:box[2], box[1]:box[3]]context_crop caffe.io.resize_image(context_crop, (crop_h, crop_w))crop np.ones(self.crop_dims, dtypenp.float32) * self.crop_meancrop[int(pad_y):int(pad_y crop_h), int(pad_x):int(pad_x crop_w)] context_crop
参考文献 1. http://nbviewer.jupyter.org/github/ouxinyu/ouxinyu.github.io/blob/master/MyCodes/caffe-master/detection.ipynb 2. https://github.com/rbgirshick/py-faster-rcnn/issues/480