ShaoqingRen / SPP_net

SPP_net : Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition
364 stars 237 forks source link

Error using caffe: API command not recognized #30

Open danielruelle opened 9 years ago

danielruelle commented 9 years ago

Hi,

When I run spp_demo from Matlab, I get the following error. Hope anyone can help to solve it. p/s: I already installed and tested caffe successfully.

spp_demo Computing candidate regions...found 2034 candidates (in 1.535s). Extracting CNN features from regions...Error using caffe API command not recognized

Error in spp_features_convX (line 61) caffe('set_gpu_available');

Error in spp_detect (line 40) feat = spp_features_convX(im, spm_im_size, [], use_gpu);

Error in spp_demo (line 40) dets = spp_detect(im, spp_model, spm_im_size, use_gpu);

Thank you very much,

ShaoqingRen commented 9 years ago

Hi @danielruelle

Are you using https://github.com/ShaoqingRen/caffe or official caffe ? I added some new functions to my version, so if you are using the official version, some modification should be made.

Best, Shaoqing

danielruelle commented 9 years ago

Hi @ShaoqingRen

I use official caffe (release candidate version: https://github.com/BVLC/caffe/releases)

Last month, I successfully built and run spp_net using https://github.com/ShaoqingRen/caffe, but now I meet the following error, so I try to use official caffe instead (but it turns out the above error: API command not recognized)

"PYCAFFE" --> using https://github.com/ShaoqingRen/caffe ./include/caffe/syncedmem.hpp: In constructor ‘caffe::SyncedMemory::SyncedMemory(sizet)’: ./include/caffe/syncedmem.hpp:67:10: warning: ‘caffe::SyncedMemory::size’ will be initialized after [-Wreorder] sizet size; ^ ./include/caffe/syncedmem.hpp:65:10: warning: ‘size_t caffe::SyncedMemory::cpucapacity’ [-Wreorder] size_t cpucapacity; ^ ./include/caffe/syncedmem.hpp:43:12: warning: when initialized here [-Wreorder] explicit SyncedMemory(const size_t size = 0) ^ python/caffe/_caffe.cpp: In member function ‘void caffe::PyNet::set_input_arrays(boost::python::api::object, boost::python::api::object)’: python/caffe/_caffe.cpp:96:14: error: ‘MemoryDataLayer’ was not declared in this scope shared_ptr<MemoryDataLayer > md_layer = ^ python/caffe/_caffe.cpp:96:35: error: template argument 1 is invalid shared_ptr<MemoryDataLayer > md_layer = ^ python/caffe/_caffe.cpp:96:37: error: expected unqualified-id before ‘>’ token shared_ptr<MemoryDataLayer > md_layer = ^ python/caffe/_caffe.cpp:98:8: error: ‘md_layer’ was not declared in this scope if (!md_layer) { ^ python/caffe/_caffe.cpp:108:50: error: ‘md_layer’ was not declared in this scope check_contiguous_array(data_arr, "data array", md_layer->datum_channels(), ^ make: *\ [python/caffe/_caffe.so] Error 1

"MATCAFFE " --> using https://github.com/ShaoqingRen/caffe

In file included from ./include/caffe/blob.hpp:6:0, from ./include/caffe/caffe.hpp:7, from matlab/caffe/matcaffe.cpp:11: ./include/caffe/syncedmem.hpp: In constructor ‘caffe::SyncedMemory::SyncedMemory(sizet)’: ./include/caffe/syncedmem.hpp:67:10: warning: ‘caffe::SyncedMemory::size’ will be initialized after [-Wreorder] sizet size; ^ ./include/caffe/syncedmem.hpp:65:10: warning: ‘size_t caffe::SyncedMemory::cpucapacity’ [-Wreorder] size_t cpucapacity; ^ ./include/caffe/syncedmem.hpp:43:12: warning: when initialized here [-Wreorder] explicit SyncedMemory(const size_t size = 0) ^

Hope you can give some suggestions,

Thanks

danielruelle commented 9 years ago

Hi @ShaoqingRen

Thanks for your reply for this problem at #29, but when I compile https://github.com/ShaoqingRen/caffe ("make pycaffe, make matcaffe"), I get the above errors. (last month, it did not show these errors, but now).

Please give some suggestions about it.

Thank you very much

danielruelle commented 9 years ago

Hi @ShaoqingRen

I just successfully made it. I did that by calling "make matcaffe" ONLY. (no "make pycaffe", "make all", "make test", and "make runtest" as in the official caffe). This means that your caffe repository may not work properly.

Notably, MemoryDataLayer file is missing so there are some errors related to this. I hope you can publish another SPP_net which is compatible with some latest caffe versions (such as release candidate version https://github.com/BVLC/caffe/releases). That would be very helpful.

Thank you,

sunshineatnoon commented 9 years ago

Hi@danielruelle, I am trying to run spp_net on mac, however I notice the author only provide caffe.mexw64 on OneDrive, I need to mex caffe on mac, do you know how to do this?

ghost commented 9 years ago

I've been facing similar errors from building your version of caffe (missing layer, MemoryDataLayer and out of scope errors). Is it possible to get an update on this if possible?