Where is the training log ?

608 views
Skip to first unread message

alexandre benoit

unread,
Mar 4, 2015, 8:38:12 AM3/4/15
to caffe...@googlegroups.com
Hi all,

must be a stupid question but until recently, one could access training log from /tmp/caffe.INFO simlink (linux user) but it seems that it does not work anymore.
And i do not see any log file in other folders.

Then, how to access training/test loss history now ?

Thanks.

Diego Rueda

unread,
Mar 4, 2015, 3:49:10 PM3/4/15
to caffe...@googlegroups.com
there are many ways, but one of them could be using script, just type script log.txt before training and it saves all your output in the file

alexandre benoit

unread,
Mar 7, 2015, 3:17:14 PM3/7/15
to caffe...@googlegroups.com
Hi,
thank you for this first reply.
Well, yes, i tested again using command line calls to caffe and log works fine (thank you for your additional hint).

however, how to get log when caffe is called from python

when calling :

solver = caffe.SGDSolver(solver_train_pathname)
solver
.solve()


In this configuration, 
_How to collect the  global log at the end of the solving process (as with the command line call when getting file pointed by /tmp/caffe.INFO)
_And also how to collect log in real time during the solving process (i guess one should replace the automatic "solve" method by several "run_forward" and "run_backward" if so how and is there another way using the solve method ?)

Thanks for help.

Suleman

unread,
Mar 3, 2016, 1:50:48 AM3/3/16
to Caffe Users
Any updates on this?

Jan C Peters

unread,
Mar 3, 2016, 4:09:23 AM3/3/16
to Caffe Users
In python you can redirect stdout and/or stderr to a file or wherever you want to capture the output, e.g. do

import sys

file
= open('output.log', 'wt')
sys
.stdout = file
sys
.stderr = file

every output after that will go into the file output.log. Even regular print commands. So that may not be entirely what you want, but it can be a workaround.

Jan

Suleman

unread,
Mar 3, 2016, 5:42:01 PM3/3/16
to Caffe Users
This works for print statements that I have in my python code, but does not write solver output to file when I call solver.solve()

Amir Abdi

unread,
Mar 3, 2016, 8:01:29 PM3/3/16
to Caffe Users
If you run the solver in command line, you can do this:
/build/tools/caffe train --solver=solver.prototxt  2>&1 | tee outputfile.txt

And of course you can do the same system call in python.

Jan C Peters

unread,
Mar 4, 2016, 3:49:48 AM3/4/16
to Caffe Users
Mhm, actually redirecting in python should work, it sure does for me. But I too find it annoying that the log is so difficult to handle, and that accuracy values and other output blobs and statistics cannot be gathered other than by parsing the log.

Jan
Reply all
Reply to author
Forward
0 new messages