Caffe不会在SIGINT上创建快照

0x1*_*337 6 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_format: HDF5
snapshot_prefix: "course-work/testing/by_solver_lr0"
snapshot_after_train: true

solver_mode: CPU
Run Code Online (Sandbox Code Playgroud)

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
Run Code Online (Sandbox Code Playgroud)

Sha*_*hai 6

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

请注意,该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.");
Run Code Online (Sandbox Code Playgroud)

这些标志可以帮助你定义朱古力对行为SIGINTSIGHUP.