大连密封材料 发表于 3 天前

防止MMdetection训练进程不测制止的终极方法-nohup

正常的MMdetection训练命令如下:
python tools/train.py <模型配置文件路径> python tools/train.py work_dirs/deformable-detr_r50_16xb2-50e_coco/deformable-detr_r50_16xb2-50e_coco.py 我们之前讲了继承前次训练的resume参数:
MMdetection规复训练命令-CSDN博客https://csdnimg.cn/release/blog_editor_html/release2.3.9/ckeditor/plugins/CsdnLink/icons/icon-default.png?t=P4F5https://blog.csdn.net/qq_54708219/article/details/148247063?spm=1001.2014.3001.5502这次我们先容另一种nohup方法,做到训练进程忽略终端信号制止:
nohup语法:
nohup <你要执行的命令> > output.log 2>&1 & 解释如下:


[*]nohup: 让命令在后台运行,纵然终端关闭也不制止。
[*]> output.log: 将标准输出重定向到output.log文件。
[*]2>&1: 将标准错误输出也重定向到标准输出(即同一个日志文件)。
[*]&: 在后台运行。
比方上面的示例:
nohup python tools/train.py work_dirs/deformable-detr_r50_16xb2-50e_coco/deformable-detr_r50_16xb2-50e_coco.py > train.log 2>&1 & 看到终端显示进程已推到后台,train.log开始记录数据即说明乐成:
https://i-blog.csdnimg.cn/direct/d1b02705048a4954868d558a73fc3333.png

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: 防止MMdetection训练进程不测制止的终极方法-nohup