mindspore-lab / mindocr

A toolbox of OCR models, algorithms, and pipelines based on MindSpore
https://mindspore-lab.github.io/mindocr/
Apache License 2.0
174 stars 44 forks source link

在910b上,使用pp-ocr v4进行推理报错 #702

Open bltcn opened 4 weeks ago

bltcn commented 4 weeks ago

镜像环境,使用的启智平台的 mindtorch0.3_mindspore2.3.0_torchnpu2.2.0_cann8.0 npu-smi info +------------------------------------------------------------------------------------------------+ | npu-smi 23.0.rc2.2 Version: 23.0.0 | +---------------------------+---------------+----------------------------------------------------+ | NPU Name | Health | Power(W) Temp(C) Hugepages-Usage(page)| | Chip | Bus-Id | AICore(%) Memory-Usage(MB) HBM-Usage(MB) | +===========================+===============+====================================================+ | 2 910B | OK | 65.3 22 0 / 0 | | 0 | 0000:41:00.0 | 0 2656 / 15665 30712/ 32768 | +===========================+===============+====================================================+ +---------------------------+---------------+----------------------------------------------------+ | NPU Chip | Process id | Process name | Process memory(MB) | +===========================+===============+====================================================+ | No running processes found in NPU 2 | +===========================+===============+====================================================+

升级了mindspore和mindspore-lite都到了2.3.0rc2

(MindSpore) [root@j55f68933650432bad20f8d74eb44c0f-task0-0 mindocr]# python deploy/py_infer/infer.py --input_images_dir=deploy/py_infer/example/dataset/cls_rec/ --det_model_path=tools/ppocr_models/ch_PP-OCRv4_det_db_dynamic_output.mindir --det_model_name_or_config=ch_pp_det_OCRv4 --cls_model_path=tools/ppocr_models/ch_PP-OCRv4_cls_mv4_dynamic_output.mindir --cls_model_name_or_config=ch_pp_mobile_cls_v2.0 --rec_model_path=tools/ppocr_models/ch_PP-OCRv4_rec_crnn_dynamic_output.mindir --rec_model_name_or_config=ch_pp_rec_OCRv4 --character_dict_path=tools/ppocr_models/ppocr_keys_v1.txt --res_save_dir=result [ERROR] MINDOCR(42836:281473356976176,Process-1:28):2024-06-01-15:07:17.703.233 [src/parallel/framework/module_base.py:40] DetPreNode init failed: daemonic processes are not allowed to have children Process Process-1:28: [ERROR] MINDOCR(42881:281473356976176,Process-1:29):2024-06-01-15:07:17.732.107 [src/parallel/framework/module_base.py:40] DetInferNode init failed: daemonic processes are not allowed to have children Traceback (most recent call last): File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 108, in run self._target(self._args, self._kwargs) File "/tmp/code/mindocr/deploy/py_infer/src/parallel/framework/module_base.py", line 41, in process_handler raise error File "/tmp/code/mindocr/deploy/py_infer/src/parallel/framework/module_base.py", line 36, in process_handler params = self.init_self_args() File "/tmp/code/mindocr/deploy/py_infer/src/parallel/module/detection/det_pre_node.py", line 13, in init_self_args self.text_detector.init(preprocess=True, model=False, postprocess=False) File "/tmp/code/mindocr/deploy/py_infer/src/infer/infer_base.py", line 29, in init self._init_model() File "/tmp/code/mindocr/deploy/py_infer/src/infer/infer_det.py", line 18, in _init_model self.model = Model( File "/tmp/code/mindocr/deploy/py_infer/src/core/model/model.py", line 15, in init self.model = _INFER_BACKEND_MAP[backend](kwargs) File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/lite_model.py", line 16, in init super().init(model_path, device, device_id) File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/model_base.py", line 28, in init self._init_model() File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/lite_model.py", line 23, in _init_model context.target = [self.device.lower()] File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/context.py", line 272, in target ascend_checker.check_env() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/_check_ascend.py", line 77, in check_env return self.check_cann_version() and self.check_lib_path() and self.check_python_deps() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/_check_ascend.py", line 193, in check_python_deps p.start() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 118, in start assert not _current_process._config.get('daemon'), \ AssertionError: daemonic processes are not allowed to have children Process Process-1:29: Traceback (most recent call last): File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 108, in run self._target(self._args, self._kwargs) File "/tmp/code/mindocr/deploy/py_infer/src/parallel/framework/module_base.py", line 41, in process_handler raise error File "/tmp/code/mindocr/deploy/py_infer/src/parallel/framework/module_base.py", line 36, in process_handler params = self.init_self_args() File "/tmp/code/mindocr/deploy/py_infer/src/parallel/module/detection/det_infer_node.py", line 12, in init_self_args self.text_detector.init(preprocess=False, model=True, postprocess=False) File "/tmp/code/mindocr/deploy/py_infer/src/infer/infer_base.py", line 29, in init self._init_model() File "/tmp/code/mindocr/deploy/py_infer/src/infer/infer_det.py", line 18, in _init_model self.model = Model( File "/tmp/code/mindocr/deploy/py_infer/src/core/model/model.py", line 15, in init self.model = _INFER_BACKEND_MAP[backend](kwargs) File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/lite_model.py", line 16, in init super().init(model_path, device, device_id) File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/model_base.py", line 28, in init self._init_model() File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/lite_model.py", line 23, in _init_model context.target = [self.device.lower()] File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/context.py", line 272, in target ascend_checker.check_env() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/_check_ascend.py", line 77, in check_env return self.check_cann_version() and self.check_lib_path() and self.check_python_deps() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/_check_ascend.py", line 193, in check_python_deps p.start() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 118, in start assert not _current_process._config.get('daemon'), \ AssertionError: daemonic processes are not allowed to have children [ERROR] MINDOCR(42937:281473356976176,Process-1:31):2024-06-01-15:07:17.776.636 [src/parallel/framework/module_base.py:40] ClsPreNode init failed: daemonic processes are not allowed to have children Process Process-1:31: Traceback (most recent call last): File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 108, in run self._target(self._args, self._kwargs) File "/tmp/code/mindocr/deploy/py_infer/src/parallel/framework/module_base.py", line 41, in process_handler raise error File "/tmp/code/mindocr/deploy/py_infer/src/parallel/framework/module_base.py", line 36, in process_handler params = self.init_self_args() File "/tmp/code/mindocr/deploy/py_infer/src/parallel/module/classification/cls_pre_node.py", line 16, in init_self_args self.text_classifier.init(preprocess=True, model=False, postprocess=False) File "/tmp/code/mindocr/deploy/py_infer/src/infer/infer_base.py", line 29, in init self._init_model() File "/tmp/code/mindocr/deploy/py_infer/src/infer/infer_cls.py", line 18, in _init_model self.model = Model( File "/tmp/code/mindocr/deploy/py_infer/src/core/model/model.py", line 15, in init self.model = _INFER_BACKEND_MAP[backend](kwargs) File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/lite_model.py", line 16, in init super().init(model_path, device, device_id) File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/model_base.py", line 28, in init self._init_model() File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/lite_model.py", line 23, in _init_model context.target = [self.device.lower()] File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/context.py", line 272, in target ascend_checker.check_env() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/_check_ascend.py", line 77, in check_env return self.check_cann_version() and self.check_lib_path() and self.check_python_deps() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/_check_ascend.py", line 193, in check_python_deps p.start() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 118, in start assert not _current_process._config.get('daemon'), \ AssertionError: daemonic processes are not allowed to have children [ERROR] MINDOCR(42973:281473356976176,Process-1:32):2024-06-01-15:07:17.818.559 [src/parallel/framework/module_base.py:40] ClsInferNode init failed: daemonic processes are not allowed to have children Process Process-1:32: Traceback (most recent call last): File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 108, in run self._target(self._args, self._kwargs) File "/tmp/code/mindocr/deploy/py_infer/src/parallel/framework/module_base.py", line 41, in process_handler raise error File "/tmp/code/mindocr/deploy/py_infer/src/parallel/framework/module_base.py", line 36, in process_handler params = self.init_self_args() File "/tmp/code/mindocr/deploy/py_infer/src/parallel/module/classification/cls_infer_node.py", line 17, in init_self_args self.text_classifier.init(preprocess=False, model=True, postprocess=True) File "/tmp/code/mindocr/deploy/py_infer/src/infer/infer_base.py", line 29, in init self._init_model() File "/tmp/code/mindocr/deploy/py_infer/src/infer/infer_cls.py", line 18, in _init_model self.model = Model( File "/tmp/code/mindocr/deploy/py_infer/src/core/model/model.py", line 15, in init self.model = _INFER_BACKEND_MAP[backend](kwargs) File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/lite_model.py", line 16, in init super().init(model_path, device, device_id) File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/model_base.py", line 28, in init self._init_model() File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/lite_model.py", line 23, in _init_model context.target = [self.device.lower()] File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/context.py", line 272, in target ascend_checker.check_env() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/_check_ascend.py", line 77, in check_env return self.check_cann_version() and self.check_lib_path() and self.check_python_deps() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/_check_ascend.py", line 193, in check_python_deps p.start() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 118, in start assert not _current_process._config.get('daemon'), \ AssertionError: daemonic processes are not allowed to have children [ERROR] MINDOCR(43008:281473356976176,Process-1:33):2024-06-01-15:07:17.859.318 [src/parallel/framework/module_base.py:40] RecPreNode init failed: daemonic processes are not allowed to have children [ERROR] MINDOCR(43036:281473356976176,Process-1:34):2024-06-01-15:07:17.887.724 [src/parallel/framework/module_base.py:40] RecInferNode init failed: daemonic processes are not allowed to have children Process Process-1:33: Traceback (most recent call last): File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 108, in run self._target(self._args, self._kwargs) File "/tmp/code/mindocr/deploy/py_infer/src/parallel/framework/module_base.py", line 41, in process_handler raise error File "/tmp/code/mindocr/deploy/py_infer/src/parallel/framework/module_base.py", line 36, in process_handler params = self.init_self_args() File "/tmp/code/mindocr/deploy/py_infer/src/parallel/module/recognition/rec_pre_node.py", line 16, in init_self_args self.text_recognizer.init(preprocess=True, model=False, postprocess=False) File "/tmp/code/mindocr/deploy/py_infer/src/infer/infer_base.py", line 29, in init self._init_model() File "/tmp/code/mindocr/deploy/py_infer/src/infer/infer_rec.py", line 61, in _init_model self.load_model(model_path) File "/tmp/code/mindocr/deploy/py_infer/src/infer/infer_rec.py", line 17, in load_model model = Model( File "/tmp/code/mindocr/deploy/py_infer/src/core/model/model.py", line 15, in init self.model = _INFER_BACKEND_MAP[backend](kwargs) File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/lite_model.py", line 16, in init super().init(model_path, device, device_id) File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/model_base.py", line 28, in init self._init_model() File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/lite_model.py", line 23, in _init_model context.target = [self.device.lower()] File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/context.py", line 272, in target ascend_checker.check_env() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/_check_ascend.py", line 77, in check_env return self.check_cann_version() and self.check_lib_path() and self.check_python_deps() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/_check_ascend.py", line 193, in check_python_deps p.start() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 118, in start assert not _current_process._config.get('daemon'), \ AssertionError: daemonic processes are not allowed to have children Process Process-1:34: Traceback (most recent call last): File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 108, in run self._target(self._args, self._kwargs) File "/tmp/code/mindocr/deploy/py_infer/src/parallel/framework/module_base.py", line 41, in process_handler raise error File "/tmp/code/mindocr/deploy/py_infer/src/parallel/framework/module_base.py", line 36, in process_handler params = self.init_self_args() File "/tmp/code/mindocr/deploy/py_infer/src/parallel/module/recognition/rec_infer_node.py", line 12, in init_self_args self.text_recognizer.init(preprocess=False, model=True, postprocess=False) File "/tmp/code/mindocr/deploy/py_infer/src/infer/infer_base.py", line 29, in init self._init_model() File "/tmp/code/mindocr/deploy/py_infer/src/infer/infer_rec.py", line 61, in _init_model self.load_model(model_path) File "/tmp/code/mindocr/deploy/py_infer/src/infer/infer_rec.py", line 17, in load_model model = Model( File "/tmp/code/mindocr/deploy/py_infer/src/core/model/model.py", line 15, in init self.model = _INFER_BACKEND_MAP[backend](kwargs) File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/lite_model.py", line 16, in init super().init(model_path, device, device_id) File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/model_base.py", line 28, in init self._init_model() File "/tmp/code/mindocr/deploy/py_infer/src/core/model/backend/lite_model.py", line 23, in _init_model context.target = [self.device.lower()] File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/context.py", line 272, in target ascend_checker.check_env() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/_check_ascend.py", line 77, in check_env return self.check_cann_version() and self.check_lib_path() and self.check_python_deps() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/site-packages/mindspore_lite/_check_ascend.py", line 193, in check_python_deps p.start() File "/home/ma-user/anaconda3/envs/MindSpore/lib/python3.9/multiprocessing/process.py", line 118, in start assert not _current_process._config.get('daemon'), \ AssertionError: daemonic processes are not allowed to have children