xujiashuai/efficientnet_b4
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

timm-efficientnet_b4.ra2_in1k - Ascend NPU 适配

1. 模型信息

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

2. 昇腾 NPU 适配结果

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

3. 推理脚本

python3 inference.py

4. 推理输出证据

=== efficientnet_b4.ra2_in1k ===
Dtype: torch.float32

--- CPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [-1.348023533821106, -1.046456217765808, -0.9795070290565491, -0.955181360244751, -0.46966567635536194]
推理时间: 380.27ms

--- NPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [-1.3478403091430664, -1.046630620956421, -0.979509174823761, -0.9552227258682251, -0.46953722834587097]
推理时间: 15.28ms

=== 精度对比 ===
Cosine Similarity: 1.000000
Max Absolute Error: 0.000848
Relative Error: 0.000709

✓ NPU 适配通过

5. 精度校验

CPU 与 NPU 推理结果对比:

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