未验证 提交 783b34c4 编写于 作者: D Double_V 提交者: GitHub

do not print stack frame when train process killed (#4346) (#4352)

* do not print stack frame when train process killed
* add note about VOT does not support windows platform!
上级 c2b24c87
......@@ -69,10 +69,12 @@ Datasets是数据集保存的路径。
## 快速开始
tracking的工作环境:
- Linux
- python3
- PaddlePaddle1.7
> 注意:如果遇到cmath无法import的问题,建议切换Python版本,建议使用python3.6.8, python3.7.0
> 注意:如果遇到cmath无法import的问题,建议切换Python版本,建议使用python3.6.8, python3.7.0 。另外,
> tracking暂不支持在window上运行,如果开发者有需求在window上运行tracking,请在issue中提出需求。
### 安装依赖
......
import os
import signal
import sys
import dataflow as df
import numpy as np
# handle terminate reader process, do not print stack frame
def _reader_quit(signum, frame):
print("Reader process exit.")
sys.exit()
def _term_group(sig_num, frame):
print('pid {} terminated, terminate group '
'{}...'.format(os.getpid(), os.getpgrp()))
os.killpg(os.getpgid(os.getpid()), signal.SIGKILL)
signal.signal(signal.SIGTERM, _reader_quit)
signal.signal(signal.SIGINT, _term_group)
class LTRLoader(df.DataFlow):
"""
Data loader. Combines a dataset and a sampler, and provides
......
......@@ -10,6 +10,25 @@ import paddle.fluid.dygraph as dygraph
import time
import numpy as np
import sys
import signal
# handle terminate reader process, do not print stack frame
def _reader_quit(signum, frame):
print("Reader process exit.")
sys.exit()
def _term_group(sig_num, frame):
print('pid {} terminated, terminate group '
'{}...'.format(os.getpid(), os.getpgrp()))
os.killpg(os.getpgid(os.getpid()), signal.SIGKILL)
signal.signal(signal.SIGTERM, _reader_quit)
signal.signal(signal.SIGINT, _term_group)
class LTRTrainer(BaseTrainer):
def __init__(self, actor, loaders, optimizer, settings, lr_scheduler=None):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册