Where is the log file?

11,728 views
Skip to first unread message

Matt

unread,
Aug 9, 2014, 10:22:32 PM8/9/14
to caffe...@googlegroups.com
When using the training tool of Caffe, is there a log file written to disk - if so, where is it?

Yangqing Jia

unread,
Aug 9, 2014, 10:44:37 PM8/9/14
to Matt, caffe...@googlegroups.com
Welcome to Caffe users!

Good question - glog actually writes it to

/tmp/<program name>.<hostname>.<user name>.log.<severity
level>.<date>.<time>.<pid>

See the following page for details:

https://google-glog.googlecode.com/svn/trunk/doc/glog.html

Yangqing


On Sat, Aug 9, 2014 at 7:22 PM, Matt <matt...@gmail.com> wrote:
> When using the training tool of Caffe, is there a log file written to disk -
> if so, where is it?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Caffe Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to caffe-users...@googlegroups.com.
> To post to this group, send email to caffe...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/caffe-users/3ed4fcac-4eca-470b-8fe8-c758fe8715bd%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Matt

unread,
Aug 10, 2014, 12:17:07 AM8/10/14
to caffe...@googlegroups.com, matt...@gmail.com
Thank you Yangqing, I indeed found it at that location.

--Matt

Sergio Guadarrama

unread,
Aug 12, 2014, 12:27:05 PM8/12/14
to caffe...@googlegroups.com, matt...@gmail.com
You can also redirect the output to a  log file using "2> filename.log"

Houqiqi Houqiqi

unread,
Jan 1, 2015, 11:00:58 PM1/1/15
to caffe...@googlegroups.com, matt...@gmail.com


Hi, where should I add "2> filename.log"? I cann't find such param in the solver.prototxt, So would you tell me more details? Thanks 

escorciav

unread,
Jan 4, 2015, 10:21:34 PM1/4/15
to caffe...@googlegroups.com, matt...@gmail.com
"2> filename.log" is a redirection command. It's NOT a proto or caffe parameter. You should append it when you call caffe binary on your shell.

Check the following links for more info:
Message has been deleted

Zhao.Kai

unread,
Oct 13, 2015, 5:30:12 AM10/13/15
to Caffe Users, matt...@gmail.com
Hi, but how to specify the log DIR when using the python interface ?

Lillian Liu

unread,
May 6, 2016, 4:26:04 PM5/6/16
to Caffe Users, matt...@gmail.com
Hello, did find out how to specify the log directory when using pycaffe?

Christos Apostolopoulos

unread,
May 6, 2016, 7:59:09 PM5/6/16
to Caffe Users, matt...@gmail.com

Jan

unread,
May 9, 2016, 4:42:49 AM5/9/16
to Caffe Users, matt...@gmail.com
For the record, if anyone is still wondering how to do this: in python (and as such also in pycaffe) you can redirect stdout simply by setting sys.stdout to a different file. Code snippet:

import sys
import caffe

# let's say we'd like to redirect caffe's output to the file caffe-output.txt:
tmp
= sys.stdout
sys
.stdout = open('caffe-output.txt', 'wt')

# now everything sent to stdout will go to the file instead. Even 'print' commands.
net
= caffe.Net('foo.prototxt', 'bar.caffemodel', caffe.TEST)
net
.forward()
print 'Even this is written to the file!'

# reset the redirection
sys
.stdout.close()
sys
.stdout = tmp

# now everything's back to normal, a print will be written to the console again
print 'This is written to the real stdout again!'


In theory you can set stdout to everything resembling a file stream, and do even more elaborate redirections.

Another hint, unrelated to python: If you want to print the output of caffe to stdout (usually the console) as well as to a file, use the 'tee' command:

$ caffe train -solver whatever.prototxt | tee output.txt

Jan

Lillian Liu

unread,
May 9, 2016, 4:31:30 PM5/9/16
to Caffe Users, matt...@gmail.com
Thank you very much Jan and Christos! I will try it out asap!

Lillian

sou...@gmail.com

unread,
Oct 3, 2016, 1:28:48 PM10/3/16
to Caffe Users, matt...@gmail.com
also $caffe train --solver .... --log_dir="..." works

Yinzhou Jiancheng

unread,
Mar 1, 2017, 12:22:57 AM3/1/17
to Caffe Users, matt...@gmail.com
Hello Jan. I have tried your solution. But it seems not working. 
The "print" output can be found in the file. But no caffe print output.

Do you know how to solve this ? Thanks.

Yinzhou

在 2016年5月9日星期一 UTC+8下午4:42:49,Jan写道:
Reply all
Reply to author
Forward
0 new messages