mmdeploy模型转换报错
收藏回复举报
mmdeploy模型转换报错
发表于2022-12-04 22:02:02
0 查看

具体过程参见:https://www.hiascend.com/forum/thread-0226105491555124024-2-1.html

使用了 dd镜像制作的 CANN 6.0.RC1.alpha003:https://www.hiascend.com/forum/thread-0217101703106643028-1-1.html

硬件环境:Atlas 200DK

CANN:CANN 6.0.RC1.alpha003

软件:MMDeploy

其中,mim, mmlab等均正常编译安装完毕。

执行模型转换脚本为:resnet18.sh

python tools/deploy.py configs/mmcls/classification_ascend_static-224x224.py resnet18_8xb32_in1k.py resnet18_8xb32_in1k_20210831-fbbb1da6.pth tests/data/tiger.jpeg --work-dir mmdeploy_models/mmcls/resnet18/cann --device cpu --dump-info 

执行过程截图如下:

cke_16040.png

cke_16532.png

报atc转换出错。

atc脚本具体为:atc --model=mmdeploy_models/mmcls/resnet18/cann/end2end.onnx --framework=5 --output=mmdeploy_models/mmcls/resnet18/cann/end2end --soc_version=Ascend310 --input_format=NCHW --input_shape=input:1,3,224,224 

具体出错文本如下:

HwHiAiUser@davinci-mini:~/mmdeploy$ sh ./resnet18.sh
/home/HwHiAiUser/.local/lib/python3.9/site-packages/mmcv/__init__.py:20: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details.
  warnings.warn(
[2022-12-04 13:55:51.011] [mmdeploy] [info] [model.cpp:98] Register 'DirectoryModel'
/home/HwHiAiUser/.local/lib/python3.9/site-packages/mmcv/__init__.py:20: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details.
  warnings.warn(
[2022-12-04 13:55:58.350] [mmdeploy] [info] [model.cpp:98] Register 'DirectoryModel'
/home/HwHiAiUser/.local/lib/python3.9/site-packages/mmcv/__init__.py:20: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details.
  warnings.warn(
[2022-12-04 13:56:05.861] [mmdeploy] [info] [model.cpp:98] Register 'DirectoryModel'
2022-12-04 13:56:05,898 - mmdeploy - INFO - Start pipeline mmdeploy.apis.pytorch2onnx.torch2onnx in subprocess
load checkpoint from local path: resnet18_8xb32_in1k_20210831-fbbb1da6.pth
2022-12-04 13:56:09,689 - mmdeploy - WARNING - DeprecationWarning: get_onnx_config will be deprecated in the future.
2022-12-04 13:56:09,690 - mmdeploy - INFO - Export PyTorch model to ONNX: mmdeploy_models/mmcls/resnet18/cann/end2end.onnx.
/home/HwHiAiUser/.local/lib/python3.9/site-packages/torch/onnx/utils.py:352: UserWarning: No input args
  warnings.warn("No input args")
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
OpenBLAS Warning : Detect OpenMP Loop and this application may hang. Please rebuild the library with USE_OPENMP=1 option.
2022-12-04 13:56:13,563 - mmdeploy - INFO - Execute onnx optimize passes.
2022-12-04 13:56:14,641 - mmdeploy - INFO - Finish pipeline mmdeploy.apis.pytorch2onnx.torch2onnx
2022-12-04 13:56:16,403 - mmdeploy - INFO - Start pipeline mmdeploy.backend.ascend.onnx2ascend.from_onnx in main process
2022-12-04 13:56:16,866 - mmdeploy - INFO - atc --model=mmdeploy_models/mmcls/resnet18/cann/end2end.onnx --framework=5 --output=mmdeploy_models/mmcls/resnet18/cann/end2end --soc_version=Ascend310 --input_format=NCHW --input_shape=input:1,3,224,224
ATC start working now, please wait for a moment.
ATC run failed, Please check the detail log, Try 'atc --help' for more information
E40001: Value [/usr/local/python-3.9.7] for environment variable [ld_library_path or ldconfig] is invalid when load python dynamic library.
        Solution: Reset the environment variable by referring to the installation guide.
        [GraphOpt][InitializeInner][InitTbeFunc] Failed to init tbe.[FUNC:InitializeInner][FILE:tbe_op_store_adapter.cc][LINE:1448]
        [SubGraphOpt][PreCompileOp][InitAdapter] InitializeAdapter adapter [tbe_op_adapter] failed! Ret [4294967295][FUNC:InitializeAdapter][FILE:op_store_adapter_manager.cc][LINE:67]
        [SubGraphOpt][PreCompileOp][Init] Initialize op store adapter failed, OpsStoreName[tbe-custom].[FUNC:Initialize][FILE:op_store_adapter_manager.cc][LINE:115]
        [FusionMngr][Init] Op store adapter manager init failed.[FUNC:Initialize][FILE:fusion_manager.cc][LINE:338]
        PluginManager InvokeAll failed.[FUNC:Initialize][FILE:ops_kernel_manager.cc][LINE:100]
        OpsManager initialize failed.[FUNC:InnerInitialize][FILE:gelib.cc][LINE:177]
        GELib::InnerInitialize failed.[FUNC:Initialize][FILE:gelib.cc][LINE:119]

Traceback (most recent call last):
  File "/home/HwHiAiUser/mmdeploy/tools/deploy.py", line 448, in <module>
    main()
  File "/home/HwHiAiUser/mmdeploy/tools/deploy.py", line 389, in main
    from_onnx(onnx_path, args.work_dir, model_inputs[model_id])
  File "/home/HwHiAiUser/mmdeploy/mmdeploy/apis/core/pipeline_manager.py", line 356, in _wrap
    return self.call_function(func_name_, *args, **kwargs)
  File "/home/HwHiAiUser/mmdeploy/mmdeploy/apis/core/pipeline_manager.py", line 326, in call_function
    return self.call_function_local(func_name, *args, **kwargs)
  File "/home/HwHiAiUser/mmdeploy/mmdeploy/apis/core/pipeline_manager.py", line 275, in call_function_local
    return pipe_caller(*args, **kwargs)
  File "/home/HwHiAiUser/mmdeploy/mmdeploy/apis/core/pipeline_manager.py", line 107, in __call__
    ret = func(*args, **kwargs)
  File "/home/HwHiAiUser/mmdeploy/mmdeploy/backend/ascend/onnx2ascend.py", line 81, in from_onnx
    assert ret_code == 0
AssertionError

注:相关脚本在CANN 5.1.RC2已顺利安装并执行模型转换和模型推理完毕。

本帖最后由 匿名用户2024/06/27 16:39:03 编辑

我要发帖子