运行caffe官方提供的jupyter 的rcnn detection,总是出现各种问题。先将问题及方法汇集在此: 
 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安装的numpy(1.13),应该降级使用1.11,(参考:https://github.com/rbgirshick/py-faster-rcnn/issues/480)但是当我降级后,caffe不能用了,因此只能按照如下方法修改:
将140行前面加上: window=window.astype(np.int64) 
 即改为:
 # Crop window from the image.window=window.astype(np.int64)crop = im[window[0]:window[2], window[1]:window[3]]将175-179改成:
   box=box.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, dtype=np.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