未验证 提交 25b1a507 编写于 作者: K Kaipeng Deng 提交者: GitHub

fix PointNet++ hang on force exit. (#4142)

上级 bbb8b366
......@@ -19,6 +19,7 @@ from __future__ import unicode_literals
import os
import os.path as osp
import signal
import numpy as np
import h5py
import random
......@@ -117,3 +118,12 @@ class Indoor3DReader(object):
return reader
def _term_reader(signum, frame):
logger.info('pid {} terminated, terminate reader process '
'group {}...'.format(os.getpid(), os.getpgrp()))
os.killpg(os.getpgid(os.getpid()), signal.SIGKILL)
signal.signal(signal.SIGINT, _term_reader)
signal.signal(signal.SIGTERM, _term_reader)
......@@ -19,6 +19,7 @@ from __future__ import unicode_literals
import os
import os.path as osp
import signal
import numpy as np
import h5py
import random
......@@ -104,3 +105,12 @@ class ModelNet40ClsReader(object):
batch_out = []
return reader
def _term_reader(signum, frame):
logger.info('pid {} terminated, terminate reader process '
'group {}...'.format(os.getpid(), os.getpgrp()))
os.killpg(os.getpgid(os.getpid()), signal.SIGKILL)
signal.signal(signal.SIGINT, _term_reader)
signal.signal(signal.SIGTERM, _term_reader)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册