Output log of Python Layers

33 views
Skip to first unread message

Jaka Cikač

unread,
Aug 31, 2017, 3:56:26 AM8/31/17
to Caffe Users
Hey guys,

i am trying to develop custom python layers for data augmentation. It seems like I have some issues with opencv (the import seems to work but calling the functions that use it don't). 

I am trying to figure out where I can see the output messages from the python layer (eg. when raising an exception or prints or error messages) as this would be the only way to actually debug it.
I checked the /tmp/ folder for caffe logs but there seems to be no output from the python layer whatsoever.

Is there any other log I am missing or how else can I debug python layers?

Thanks and kind regards,
Jaka

Hieu Do Trung

unread,
Aug 31, 2017, 5:29:09 AM8/31/17
to Caffe Users
I saw output messages from python layer in Linux terminal normally, and also on jupyter notebook (on browser).
Just use "print" in python layer - it should do the work.
Exception also print messages to those standard outputs.

To check, you can put a
raise Exception("Should stop here!") 
at the normal path of code execution in the reshape function for example:

def reshape(self, bottom, top):
    raise Exception("Should stop here!") 
    # other code here

you should see the message on terminal!

Jaka Cikač

unread,
Sep 6, 2017, 10:20:25 AM9/6/17
to Caffe Users
Thanks for your answer!
Reply all
Reply to author
Forward
0 new messages