12

I am using apollocaffe and Reinspect. Apollocaffe is in c++ library and Reinspect is in python. Reinspect called apis from apollocaffe. I like to debug those apis inside apollocaffe. From python code, I used

python -m pdb train.py 

But I can't go inside api from apollocaffe. I do like cout << "test" << endl; in apollocaffe. But nothing is printed to console. How can I debug c++ code, at least if I can print, it will be great.

1 Answer 1

17

If you are interested to debug just the C++ part, you can just start GDB with Python -

gdb python b <C++ function to break at> run train.py 

Of course you need to compile Caffe with debug information: pass -DDEBUG=1 to cmake options of uncomment the DEBUG = 1 line in your Makefile.config.
Debugging both Python and C++ from gdb might be more complicated, see this for example.

Sign up to request clarification or add additional context in comments.

7 Comments

Have you tried the standard cout / printf? These should work.
does the C++ library that you are using contain the debug flag?
@SheikhFaisalMiskhat You're right, thanks. Edited the answer accordingly.
@SheikhFaisalMiskhat yes in the makefile.config, DEBUG := 1 is uncommented.
@rursw1 yes I used cout. but doesn't print to console
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.