当我在终端中按 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
tool有两个标志
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.");
这些标志可以帮助您在 SIGINT 上定义 caffe 的行为。和 SIGHUP .
关于neural-network - Caffe 不会在 SIGINT 上制作快照,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35438160/