Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caffe not saving solverstate when using tee to redirect the output #5323

Closed
eamadord opened this issue Feb 23, 2017 · 1 comment
Closed

Caffe not saving solverstate when using tee to redirect the output #5323

eamadord opened this issue Feb 23, 2017 · 1 comment

Comments

@eamadord
Copy link

Hi,

I'm using Caffe over Ubuntu 16.04, and the command I am using to train my net is the following:
$CAFFE_ROOT/build/tools/caffe train -solver solver.prototxt 2>&1 | tee file.log

However, when I try to stop the training manually using Ctrl ^C, Caffe does not generate a solverstate file, neither a caffemodel. If I omit the redirection to a file and try to stop the training, that issue does not happen, and both my solverstate and caffemodel generate successfully.

Is there a way to fix this?

Thanks in advance.

@Noiredd
Copy link
Member

Noiredd commented Feb 23, 2018

When you redirect output to tee, you're actually interacting with tee itself in the console - so Ctrl+C actually sends an interrupt signal to tee, not Caffe. And it appears that tee just kills its input process when you do that.

You can go around it by sending a SIGINT signal directly to Caffe (from another console):
kill -2 <caffe_pid>

Protip: each line of the log
I0223 15:00:57.606747 12078 sgd_solver.cpp:105] Iteration 0, lr = 0.001
contains a PID on the third position (here: 12078).

@Noiredd Noiredd closed this as completed Feb 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants