sergeyk / selective_search_ijcv_with_python

Simple Python script to compute Selective Search proposals in Matlab.
Other
183 stars 113 forks source link

problem with detect.py using selective_search #6

Open sailes437 opened 10 years ago

sailes437 commented 10 years ago

I am trying to run a detection program on caffe (https://github.com/BVLC/caffe) the file detect.py uses selective search. I have downloaded the selective_search_ijcv_with_python. The demo.m file runs fine with MATLAB and works. Also the selective_search.py file executes fine and gives result. But when i try to run detect.py file (that uses selective search) it schows error. File "/usr/lib/python2.7/dist-packages/scipy/io/matlab/miobase.py", line 217, in get_matfile_version buffer = fileobj.read(4)) TypeError: buffer is too small for requested array I have found some forum talks saying that it has something to do with scipy, numpy but i dont understand what. Thanks in advance.

cmxnono commented 10 years ago

I had the same problem.:(

sergeyk commented 10 years ago

This usually means that the Matlab code is actually not outputting anything meaningful. Look at the temporary file that selective search outputs -- it's probably 0 bytes.

On Fri, Oct 31, 2014 at 4:26 AM, cmxnono notifications@github.com wrote:

I had the same problem.:(

— Reply to this email directly or view it on GitHub https://github.com/sergeyk/selective_search_ijcv_with_python/issues/6#issuecomment-61247798 .

ghost commented 10 years ago

@sergeyk I think all of us are following the guidelines from the webpage below. http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/detection.ipynb So do you have any advice when facing TypeError: buffer is too small for requested array?

Thank you!

sergeyk commented 10 years ago

Find the file that python is trying to load and confirm that it actually has contents (matlab can open it). If it doesn't, the matlab code isn't being called correctly or isn't doing what it's supposed to -- there's a number of possible reasons for that, and you'll have to figure it out.

On Wed, Nov 5, 2014 at 9:02 AM, viczong notifications@github.com wrote:

@sergeyk https://github.com/sergeyk I think all of us are following the guidelines from the webpage below.

http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/detection.ipynb So do you have any advice when facing TypeError: buffer is too small for requested array?

Thank you!

— Reply to this email directly or view it on GitHub https://github.com/sergeyk/selective_search_ijcv_with_python/issues/6#issuecomment-61842912 .

ghost commented 10 years ago

@sergeyk I get to know the problem just now, thank you for your quick reply!

To all that may face this problem:

If you follow the instruction from http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/detection.ipynb and face the above problem, you should check _temp folder and to see whether the path mentioned in det_input.txt is right.

sailes437 commented 10 years ago

The problem was because the path to the image was not correct. So the .mat file was not created correctly. Thanks for all your help :)

tminkus commented 9 years ago

If others are having this same problem even after fixing the image path, here's how I solved this problem: the matlab scripts in this project require the Image Processing toolkit add-on to be installed, so it's not enough to have a standalone student version of Matlab. After I installed the Image Processing add-on, this error went away and the module worked as expected.

mtrth commented 9 years ago

Hi I am trying to use selective search on a 8-channel image, and I am facing similar error

File "/usr/lib/python2.7/dist-packages/scipy/io/matlab/miobase.py", line 217, in get_matfile_version buffer = fileobj.read(4)) TypeError: buffer is too small for requested array

But if I follow the instruction from http://nbviewer.ipython.org/github/BVLC/caffe/blob/master/examples/detection.ipynb and test it on a (3channel) RGB image it works fine. Is it because selective search cannot work on a k-channel image ?

byshen commented 9 years ago

Thank you so much !!!

Lvhhhh commented 8 years ago

@sergeyk when i write python selective_search.py . and it say: scipy.io.matlab.miobase.MatReadError: Mat file appears to be empty. my platform is windows.and i change"\dev\null" to "NUL".

fmsxwbh commented 7 years ago

@Lvhhhh I have the same problem did you solve it yet?

pond918 commented 7 years ago

i changed '/dev/null' to os.devnull