对om模型进行推理时报错,使用原生的acl、aclruntime、ais_bench三种方式都同错。同样的代码和权重,在启智平台的云脑任务中可以成功
收藏回复举报
对om模型进行推理时报错,使用原生的acl、aclruntime、ais_bench三种方式都同错。同样的代码和权重,在启智平台的云脑任务中可以成功
t('forum.solved') 已解决
新人帖
发表于2025-03-13 16:00:11
0 查看

以下完全同样的代码和步骤,在启智平台上的云脑任务,使用910A卡可以正常运行,但是另一台物理机上失败。

步骤:

环境:cann 8.0.RC1

cke_14365.png

1. 使用atc将onnx模型转换成om模型:成功

2. 查看om模型的输入输出结构:成功

3. 使用from ais_bench.infer.interface import InferSession进行推理,命令行卡死,过几分钟后报错,报错内容如下:

[INFO] exception_cb streamId:14 taskId:19 deviceId: 0 opName:/sample_func/Pad inputCnt:3 outputCnt:1
[ERROR] open file failed
[ERROR] save tensor memory to file: open file failed.
[WARN] exception_cb input_0 save failed
[ERROR] open file failed
[ERROR] save tensor memory to file: open file failed.
[WARN] exception_cb input_0 save failed
[ACL ERROR] EZ9999: Inner Error!
EZ9999: 2025-03-13-07:53:45.581.278  The error from device(0), serial number is 8, there is an aicore error, core id is 0, error code = 0, dump info: pc start: 0x1000124083ae6000, current: 0x124083ae61a4, vec error info: 0x1dedf57d, mte error info: 0x5d, ifu error info: 0x3f54772f5f100, ccu error info: 0, cube error info: 0xf4, biu error info: 0, aic error mask: 0x65000200d000288, para base: 0x124083ac00a8, errorStr: time out or trap error.[FUNC:PrintCoreErrorInfo][FILE:device_error_proc.cc][LINE:537]
        TraceBack (most recent call last):

测试代码:

from ais_bench.infer.interface import InferSession
import numpy as np
if __name__ == '__main__':
    step2_session = InferSession(device_id=0, model_path="xxxx.om"))
    intensors_desc = step2_session.get_inputs()
    for i, info in enumerate(intensors_desc):
        print(
            f"input info i:{i} shape:{info.shape} type:{info.datatype} val: \
                     {int(info.datatype)} realsize:{info.realsize} size:{info.size}"
        )

    outputs = step2_session.infer([np.zeros((1, 2, 1024), dtype=np.float32), 
                                   np.zeros((1, 3,512,512), dtype=np.float32),
                                   np.zeros((1, 224), dtype=np.float32), 
                                   np.zeros((1, 107), dtype=np.float32), 
                                   np.zeros((1, 3, 3), dtype=np.float32), 
                                   np.zeros((1, 3, 1), dtype=np.float32), 
                                   np.zeros((1, 3, 3), dtype=np.float32), 
                                   ])
    print("推理结果形状:", [out.shape for out in outputs])

我要发帖子