dongfangduoshou123 / DaSiamRPN-Caffe2

Distractor-aware Siamese Networks for Visual Object Tracking Inference in C++ powered by Caffe2
MIT License
41 stars 12 forks source link

Which version of caffe2 do you use? #11

Closed PapaMadeleine2022 closed 5 years ago

PapaMadeleine2022 commented 5 years ago

Hello, I get the caffe_old from the url you provide in README.md, but I do not know which version it is.

dongfangduoshou123 commented 5 years ago

https://github.com/dongfangduoshou123/DaSiamRPN-Caffe2/issues/7 In this issue, have the url to download the caffe2 version what i used.

In CmakeLists.txt of root dir, has the info of version like: project(Caffe2 CXX C)

set(CAFFE2_VERSION_MAJOR 0) set(CAFFE2_VERSION_MINOR 8) set(CAFFE2_VERSION_PATCH 2) set(CAFFE2_VERSION

which means the version is 0.8.2

PapaMadeleine2022 commented 5 years ago

@dongfangduoshou123 Thanks for your quick reply. But I get a problem when using your pytorch. I successfully install caffe2 to my /xxx/local/anaconda2/lib/python2.7/site-packages: by running python setup.py install using conda env. But I can not import caffe2, it shows error:

 File "transferToCaffe2.py", line 14, in <module>
    from caffe2.python import core
ImportError: No module named caffe2.python

Of course, I add the dir /xxx/local/anaconda2/lib/python2.7/site-packages: to my PYTHONPATH. Can you give some advises?

dongfangduoshou123 commented 5 years ago

I install caffe2 by use cmake to /usr/local. your /xxx/local/anaconda2/lib/python2.7/site-packages dir has the caffe2 sub_dir? maybe you installed it to /xxx/local/anaconda2/lib/python2.7/site-packages/dist-packages

PapaMadeleine2022 commented 5 years ago

@dongfangduoshou123 Thanks for your reply. Whoops, when I use cmake as you said above, I can install caffe2 successfully, but got another error when run python transferToCaffe2.py:

WARNING:root:This caffe2 python run does not have GPU support. Will run in CPU only mode.
WARNING:root:Debug message: No module named caffe2_pybind11_state_gpu
CRITICAL:root:Cannot load caffe2.python. Error: /xxx/pytorch_dongfangduoshou123/build/caffe2/python/caffe2_pybind11_state.so: undefined symbol: _ZTVN6caffe213EnforceNotMetE

And Suggest you update your project for the latest caffe2 when you have time and give a more detailed docs about how to run your code.

dongfangduoshou123 commented 5 years ago

It's not the transferToCaffe2.py's problem, caffe2's is import failed.

your caffe2 maybe not installed correctly; this log "WARNING:root:This caffe2 python run does not have GPU support. Will run in CPU only mode." means you install caffe2 without GPU support.

The useage of this script is just run: python transferToCaffe2.py

Note:you need edit line 190 (pnet.load_state_dict(torch.load('/opt/about_tracking/SiamRPNBIG.model'))) to your path, I have not add command line support for params yet.

I think you can install caffe2 successfully, and import caffe2 in python successfully(which is your the problem), then the code will be work well.