From 585e34b229df9953d76f05d6d36644599cc8df30 Mon Sep 17 00:00:00 2001 From: RunningLeon Date: Thu, 7 Jul 2022 15:00:55 +0800 Subject: [PATCH] fix wrong exit code in pipeline_manager (#715) * fix exit * change to general exit errorcode=1 --- mmdeploy/apis/core/pipeline_manager.py | 2 +- mmdeploy/backend/pplnn/utils.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mmdeploy/apis/core/pipeline_manager.py b/mmdeploy/apis/core/pipeline_manager.py index ab6df3cf37..0cd80f62e8 100644 --- a/mmdeploy/apis/core/pipeline_manager.py +++ b/mmdeploy/apis/core/pipeline_manager.py @@ -79,7 +79,7 @@ def pop_mp_output(self, call_id: int = None) -> Any: if call_id not in self._mp_dict: get_root_logger().error( f'`{self._func_name}` with Call id: {call_id} failed. exit.') - exit() + exit(1) ret = self._mp_dict[call_id] self._mp_dict.pop(call_id) return ret diff --git a/mmdeploy/backend/pplnn/utils.py b/mmdeploy/backend/pplnn/utils.py index f18d453303..63b429f5c4 100644 --- a/mmdeploy/backend/pplnn/utils.py +++ b/mmdeploy/backend/pplnn/utils.py @@ -37,14 +37,14 @@ def register_engines(device_id: int, x86_engine = pplnn.X86EngineFactory.Create(x86_options) if not x86_engine: logger.error('Failed to create x86 engine') - sys.exit(-1) + sys.exit(1) if disable_avx512: status = x86_engine.Configure(pplnn.X86_CONF_DISABLE_AVX512) if status != pplcommon.RC_SUCCESS: logger.error('x86 engine Configure() failed: ' + pplcommon.GetRetCodeStr(status)) - sys.exit(-1) + sys.exit(1) engines.append(pplnn.Engine(x86_engine)) @@ -55,7 +55,7 @@ def register_engines(device_id: int, cuda_engine = pplnn.CudaEngineFactory.Create(cuda_options) if not cuda_engine: logger.error('Failed to create cuda engine.') - sys.exit(-1) + sys.exit(1) if quick_select: status = cuda_engine.Configure( @@ -63,7 +63,7 @@ def register_engines(device_id: int, if status != pplcommon.RC_SUCCESS: logger.error('cuda engine Configure() failed: ' + pplcommon.GetRetCodeStr(status)) - sys.exit(-1) + sys.exit(1) if input_shapes is not None: status = cuda_engine.Configure(pplnn.CUDA_CONF_SET_INPUT_DIMS, @@ -72,7 +72,7 @@ def register_engines(device_id: int, logger.error( 'cuda engine Configure(CUDA_CONF_SET_INPUT_DIMS) failed: ' + pplcommon.GetRetCodeStr(status)) - sys.exit(-1) + sys.exit(1) if export_algo_file is not None: status = cuda_engine.Configure(pplnn.CUDA_CONF_EXPORT_ALGORITHMS, @@ -81,7 +81,7 @@ def register_engines(device_id: int, logger.error( 'cuda engine Configure(CUDA_CONF_EXPORT_ALGORITHMS) ' 'failed: ' + pplcommon.GetRetCodeStr(status)) - sys.exit(-1) + sys.exit(1) if import_algo_file is not None: status = cuda_engine.Configure(pplnn.CUDA_CONF_IMPORT_ALGORITHMS, @@ -90,7 +90,7 @@ def register_engines(device_id: int, logger.error( 'cuda engine Configure(CUDA_CONF_IMPORT_ALGORITHMS) ' 'failed: ' + pplcommon.GetRetCodeStr(status)) - sys.exit(-1) + sys.exit(1) engines.append(pplnn.Engine(cuda_engine))