Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using imresize #8

Closed
xmubingo opened this issue Sep 15, 2015 · 4 comments
Closed

Error using imresize #8

xmubingo opened this issue Sep 15, 2015 · 4 comments

Comments

@xmubingo
Copy link

Thanks in advance!

Environment:
CentOS release 6.3
gcc version 4.8.2 (GCC)
Maltab R2013a (8.1.0.604) 64-bit (glnxa64)

When run 'script_faster_rcnn_demo.m', I got this error:


....
I0915 13:13:05.486282 28509 net.cpp:746] Copying source layer fc6
I0915 13:13:05.581735 28509 net.cpp:746] Copying source layer relu6
I0915 13:13:05.581773 28509 net.cpp:746] Copying source layer drop6
I0915 13:13:05.581779 28509 net.cpp:746] Copying source layer fc7
I0915 13:13:05.597371 28509 net.cpp:746] Copying source layer relu7
I0915 13:13:05.597409 28509 net.cpp:746] Copying source layer drop7
I0915 13:13:05.597415 28509 net.cpp:746] Copying source layer fc7_drop7_0_split
I0915 13:13:05.597421 28509 net.cpp:746] Copying source layer cls_score
I0915 13:13:05.597509 28509 net.cpp:746] Copying source layer bbox_pred
I0915 13:13:05.597848 28509 net.cpp:746] Copying source layer cls_prob
Error using imresize
Expected input number 1, A, to be one of these types:

numeric, logical

Instead its type was gpuArray.

Error in imresize>parsePreMethodArgs (line 333)
validateattributes(A, {'numeric', 'logical'}, {'nonsparse', 'nonempty'}, mfilename, 'A', 1);

Error in imresize>parseInputs (line 248)
[params.A, params.map, params.scale, params.output_size] = ...

Error in imresize (line 141)
params = parseInputs(varargin{:});

Error in prep_im_for_blob (line 30)
im = imresize(im, im_scale);

Error in proposal_im_detect>get_image_blob (line 74)
[blob, im_scales] = prep_im_for_blob(im, conf.image_means, conf.test_scales, conf.test_max_size);

Error in proposal_im_detect (line 10)
[im_blob, im_scales] = get_image_blob(conf, im);

Error in script_faster_rcnn_demo (line 55)

[boxes, scores] = proposal_im_detect(proposal_detection_model.conf_proposal, rpn_net, im);

maybe the imsize function do not support gpuArray? Thanks again.

@ShaoqingRen
Copy link
Owner

It seems that your Matlab does not have the over overloading of imresize for gpuArray.

A simple modification is that, you can commente out
Line 52, 76 in script_faster_rcnn_demo.m
"im = gpuArray(im);"

Thus the operation of image resize will use cpu instead of gpu. A side effect is slower testing speed.

@xmubingo
Copy link
Author

@ShaoqingRen hi, i also commented Line 28,29, then succeeded. Thanks!
---K40----
001763.jpg (500x375): time 0.268s (resize+conv+proposal: 0.204s, nms+regionwise: 0.064s)
004545.jpg (500x375): time 0.272s (resize+conv+proposal: 0.206s, nms+regionwise: 0.066s)
000542.jpg (500x375): time 0.245s (resize+conv+proposal: 0.207s, nms+regionwise: 0.038s)
000456.jpg (500x375): time 0.269s (resize+conv+proposal: 0.208s, nms+regionwise: 0.061s)
001150.jpg (500x375): time 0.261s (resize+conv+proposal: 0.208s, nms+regionwise: 0.053s)
mean time: 0.263s

@HaozhiQi
Copy link

HaozhiQi commented Nov 8, 2015

@ShaoqingRen Hi, I also encounter this problem this morning. The reason I wrote this comment is that I found even after I comment line 52,76 and line 28, 29 (as suggest by @xmubingo), there is still an error in the num.m. Actually the error occurs on line 34

nms_gpu_mex(single(boxes)', double(overlap));

and line 43

nms_mex(double(boxes), double(overlap));

both say the function is undefined.

Therefore I thought if I miss some installation steps? I'm using matlab 2013a and I'm sure to execute make matcaffe with no errors (caffe in this repository).

And currently my solution is using this file https://github.com/rbgirshick/fast-rcnn/blob/master/matlab/nms.m to temporarily replace nms.m. (Plus adding a peudo parameter use_gpu) Any suggestions?

Thank you for your time!

@moreaba
Copy link

moreaba commented May 19, 2016

@oh233

You have this problem because matlab can not find the mex file that contains the function.
so the file in "functions/nms/nms_mex.cpp" and "functions/nms/nms_gpu_mex.cu" need to be compiled!

you can compile them by running the script called: "faster_rcnn_build.m" in the home directory as mentioned in the README.md

See Snapshot
Undefined function 'nms_mex' for input arguments of type 'double'.

kukuruza pushed a commit to kukuruza/faster_rcnn that referenced this issue May 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants