xujiashuai/hrnet_w18_small_v2_ms
模型介绍文件和版本Pull Requests讨论分析
下载使用量0

hrnet_w18_small_v2.ms_in1k on Ascend NPU

1. 简介

本文档记录 timm/hrnet_w18_small_v2.ms_in1k (HRNet-W18-Small-V2) 在昇腾 NPU 上的适配验证结果。

  • 模型来源: timm/hrnet_w18_small_v2.ms_in1k
  • 架构: HRNet-W18-Small-V2
  • 参数量: ~13M
  • 任务: Image Classification (图像分类, ImageNet-1K, 1000类)
  • 适配状态: SUCCESS
  • 适配时间: 2026-05-18

2. 验证环境

组件版本
torch2.9.0
torch-npu2.9.0.post1
timm1.0.27
CANN8.5.1
  • NPU: Ascend 910B4
  • 系统: Linux aarch64

3. 推理脚本

source setup_env.sh && /usr/local/python3.11.14/bin/python3 deliverables/hrnet_w18_small_v2_ms/inference.py

4. 推理输出证据

=== hrnet_w18_small_v2.ms_in1k ===
Dtype: torch.float32

--- CPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [-0.9414, 1.8682, -2.0233, -4.1299, 1.0156]
推理时间: 317.90ms

--- NPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [-0.9418, 1.8682, -2.0228, -4.1292, 1.0166]
推理时间: 17.57ms

=== 精度对比 ===
Cosine Similarity: 1.000000
Max Absolute Error: 0.003780
Relative Error: 0.004305

✓ NPU 适配通过

5. 性能参考

指标数值
NPU 平均延迟17.57 ms
CPU 推理时间317.90 ms

6. CPU vs NPU 精度对比

指标数值
Cosine Similarity1.000000
Max Abs Error0.003780
Relative Error0.004305
是否满足要求是(cosine=1.0)

7. 评测材料

材料文件说明
推理脚本inference.py独立可运行的 NPU 推理代码
评测报告report.json结构化评测结果

8. 注意事项

  • 使用 timm 库的 hrnet_w18_small_v2.ms_in1k 模型定义
  • 权重通过 timm 从 HuggingFace Hub 下载(hf-mirror)
  • 输入: 随机 224x224 RGB 图像
  • 输出: 1000 类 ImageNet 分类 logits

贡献者: xujiashuai 参赛赛道: 模型适配赛道 提交时间: 2026-05-18