xujiashuai/timm-coatnet_nano_rw_224.sw_in1k
Model Introduction
Files & versions
Pull Requests
Discussion
Analysis

timm-coatnet_nano_rw_224.sw_in1k - Ascend NPU 适配

1. 模型信息

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

2. 昇腾 NPU 适配结果

指标值
设备Ascend 910B4
精度float32
Cosine Similarity0.999947
Max Absolute Error0.002801
NPU 推理时间10.66ms

3. 推理脚本

python3 inference.py

4. 推理输出证据

=== coatnet_nano_rw_224.sw_in1k ===
Dtype: torch.float32

--- CPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [-0.1379498988389969, -0.04001997038722038, -0.007581891492009163, -0.01759815774857998, -0.04068147763609886]
推理时间: 275.23ms

--- NPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [-0.13677313923835754, -0.03997330367565155, -0.006345365196466446, -0.016826186329126358, -0.03926972672343254]
推理时间: 10.66ms

=== 精度对比 ===
Cosine Similarity: 0.999947
Max Absolute Error: 0.002801
Relative Error: 0.052179

✓ NPU 适配通过

5. 精度校验

  • Cosine Similarity: 0.999947 (> 0.99 通过)
  • Max Absolute Error: 0.002801

6. 复现步骤

pip install torch torch_npu timm huggingface_hub safetensors
python3 inference.py

7. 环境要求

  • Python 3.11+, PyTorch 2.9.0+, torch_npu 2.9.0+, CANN 8.5.1, Ascend 910B4

8. Agent Skill

本适配由 vision-encoder-npu-adapt Agent Skill 自动完成。