Neural network Caffe不会在SIGINT上创建快照

Neural network Caffe不会在SIGINT上创建快照,neural-network,deep-learning,caffe,Neural Network,Deep Learning,Caffe,当我在终端中按CTRL+C时,caffe停止训练,但不制作快照。如何修复它? 我的解算器: net: "course-work/testing/model.prototxt" test_iter: 200 test_interval: 500 base_lr: 0.001 momentum: 0.9 weight_decay: 0.005 lr_policy: "fixed" display: 50 max_iter: 60000 snapshot: 5000 snapshot_forma

当我在终端中按CTRL+C时,caffe停止训练,但不制作快照。如何修复它? 我的解算器:

net: "course-work/testing/model.prototxt"
test_iter: 200
test_interval: 500

base_lr: 0.001
momentum: 0.9
weight_decay: 0.005
lr_policy: "fixed"

display: 50
max_iter: 60000

snapshot: 5000
snapshot_format: HDF5
snapshot_prefix: "course-work/testing/by_solver_lr0"
snapshot_after_train: true

solver_mode: CPU
Bash脚本:

TOOLS=./build/tools
NET_DIR=course-work/testing

$TOOLS/caffe train \
    --solver=$NET_DIR/solver_lr0.prototxt 2>&1 | tee $NET_DIR/1.log

通过
tee
和管道重定向caffe的输出可能会改变操作系统处理和向进程传输信号的方式。尽量避免
| tee
以确保
SIGINT
到达caffe

注意,它有两个标志

DEFINE_string(sigint_effect, "stop",
             "Optional; action to take when a SIGINT signal is received: "
              "snapshot, stop or none.");
DEFINE_string(sighup_effect, "snapshot",
             "Optional; action to take when a SIGHUP signal is received: "
             "snapshot, stop or none.");

这些标志可以帮助您定义caffe在和上的行为。

记录caffe输出的好方法是

GLOG_log_dir=/path/to/log/dir $CAFFE_ROOT/bin/caffe.bin train 
—solver=/path/to/solver.prototxt

这会实时记录caffe输出,并且肯定会到达caffe。

我在拍摄到HDF5时遇到问题,请尝试拍摄到BINARYPROTO。@Shai这很奇怪,但当我通过
kill-s SIGINT
直接发送SIGINT时,caffe会制作快照
CTRL+C
仍然不起作用。是否可能是由于
tee
管道,来自键盘的信号以某种方式被定向到另一个进程?@Shai是的,你是对的<代码>发球是个问题。非常感谢。记录输出的另一种方法是什么?@shaunakde我通常使用
screen
并在前台重定向到文件,这是如何解决问题的?GLOG_log_dir是什么意思?Caffe使用Google日志库(GLOG),GLOG_log_dir指定日志文件的目录。