使用torch_npu推理pth模型,运行报错了
收藏回复举报
使用torch_npu推理pth模型,运行报错了
t('forum.solved') 已解决
发表于2024-07-29 10:37:01
0 查看

报错信息如下,使用的是cann 7.0.0,python版本是3.9,torch使用的是1.11.0,torch_npu简单的测试运行代码是可以正常执行的。传入模型地址是pth,目前是在模型推理的model(input_frames)感觉报了以下的错,求助。

/usr/local/miniconda3/lib/python3.9/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: 

  warn(f"Failed to load image Python extension: {e}")

OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'

OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'

Traceback (most recent call last):

  File "/usr/local/miniconda3/lib/python3.9/runpy.py", line 197, in _run_module_as_main

    return _run_code(code, main_globals, None,

  File "/usr/local/miniconda3/lib/python3.9/runpy.py", line 87, in _run_code

    exec(code, run_globals)

  File "/home/HwHiAiUser/project/monitor/monitor/Fight_Detection/infer.py", line 41, in <module>

    main()

  File "/home/HwHiAiUser/project/monitor/monitor/Fight_Detection/infer.py", line 31, in main

    predict_on_video(args.inputPath, args.outputPath, model, args.sequenceLength, args.skip, args.showInfo)

  File "/home/HwHiAiUser/project/monitor/monitor/Fight_Detection/UtilsFiles/Fight_utils.py", line 382, in predict_on_video

    predicted_class_name= PredTopKClass(1,frames_queue, model)

  File "/home/HwHiAiUser/project/monitor/monitor/Fight_Detection/UtilsFiles/Fight_utils.py", line 257, in PredTopKClass

    outputs = model(input_frames)

  File "/usr/local/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl

    return forward_call(*input, **kwargs)

  File "/usr/local/miniconda3/lib/python3.9/site-packages/torchvision/models/video/resnet.py", line 251, in forward

    x = self.stem(x)

  File "/usr/local/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl

    return forward_call(*input, **kwargs)

  File "/usr/local/miniconda3/lib/python3.9/site-packages/torch/nn/modules/container.py", line 141, in forward

    input = module(input)

  File "/usr/local/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl

    return forward_call(*input, **kwargs)

  File "/usr/local/miniconda3/lib/python3.9/site-packages/torch/nn/modules/conv.py", line 592, in forward

    return self._conv_forward(input, self.weight, self.bias)

  File "/usr/local/miniconda3/lib/python3.9/site-packages/torch/nn/modules/conv.py", line 587, in _conv_forward

    return F.conv3d(

RuntimeError: InnerRun:build/CMakeFiles/torch_npu.dir/compiler_depend.ts:215 NPU error, error code is 500002

[Error]: A GE error occurs in the system.

        Rectify the fault based on the error information in the ascend log.

EZ3002: Optype [Conv3D] of Ops kernel [AIcoreEngine] is unsupported. Reason: [Static shape check]:data type DT_FLOAT of input [x] is not supported. All supported data type and format of tensor input0.x is: Data Type: {DT_FLOAT16,DT_INT8}Format:{NDC1HWC0,NDC1HWC0}[tbe-custom]:op type Conv3D is not found in this op store.[tbe-builtin]:[Static shape check]:data type DT_FLOAT of input [x] is not supported. All supported data type and format of tensor input0.x is: Data Type: {DT_FLOAT16,DT_INT8}Format:{NDC1HWC0,NDC1HWC0}.

        Possible Cause: The operator type is unsupported in the operator information library due to specification mismatch.

        Solution: Submit an issue to request for support at https://gitee.com/ascend, or remove this type of operators from your model.

        TraceBack (most recent call last):

        No supported Ops kernel and engine are found for [Conv3D36], optype [Conv3D].

        build graph failed, graph id:35, ret:-1[FUNC:BuildModelWithGraphId][FILE:ge_generator.cc][LINE:1615]

        [Build][SingleOpModel]call ge interface generator.BuildSingleOpModel failed. ge result = 4294967295[FUNC:ReportCallError][FILE:log_inner.cpp][LINE:161]

        [Build][Op]Fail to build op model[FUNC:ReportInnerError][FILE:log_inner.cpp][LINE:145]

        build op model failed, result = 500002[FUNC:ReportInnerError][FILE:log_inner.cpp][LINE:145]

本帖最后由 匿名用户2024/08/07 14:29:41 编辑

我要发帖子