xujiashuai/timm-resnet34_tv
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

timm-resnet34.tv_in1k - Ascend NPU 适配

1. 模型信息

  • 模型: timm-resnet34.tv_in1k
  • 来源: timm
  • 任务: ImageNet 图像分类

2. 昇腾 NPU 适配结果

指标值
设备Ascend 910B4
精度float32
Cosine Similarity1.000000
Max Absolute Error0.003046
NPU 推理时间4.13ms

3. 推理脚本

python3 inference.py

4. 推理输出证据

=== resnet34 ===
Dtype: torch.float32

--- CPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [-0.5793046951293945, 1.9982730150222778, -0.27614259719848633, -0.6634020209312439, 2.9013991355895996]
推理时间: 99.00ms

--- NPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [-0.5794236660003662, 1.9976096153259277, -0.2758776843547821, -0.6622819304466248, 2.9019932746887207]
推理时间: 4.13ms

=== 精度对比 ===
Cosine Similarity: 1.000000
Max Absolute Error: 0.003046
Relative Error: 0.001518

✓ NPU 适配通过

5. 精度校验

CPU 与 NPU 推理结果对比:

  • Cosine Similarity: 1.000000 (> 0.99 通过)
  • Max Absolute Error: 0.003046