xujiashuai/timm-swin_large_patch4_window7_224.ms_in22k_ft_in1k
模型介绍文件和版本Pull Requests讨论分析
下载使用量0

timm-swin_large_patch4_window7_224.ms_in22k_ft_in1k - 昇腾 NPU 适配

1. 模型信息

  • 模型: timm-swin_large_patch4_window7_224.ms_in22k_ft_in1k
  • 来源: timm
  • 任务: ImageNet 图像分类
  • 分辨率: 224x224

2. 昇腾 NPU 适配结果

指标值
设备Ascend 910B4
精度float32
余弦相似度1.000000
最大绝对误差0.001460
NPU 推理时间17.46ms

3. 推理脚本

python3 inference.py

4. 推理输出证据

=== swin_large_patch4_window7_224.ms_in22k_ft_in1k ===
Dtype: torch.float32
Resolution: 224

--- CPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [0.3216012418270111, 0.4524024426937103, 0.3666832447052002, 0.5126559138298035, 0.3668920397758484]
推理时间: 678.10ms

--- NPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [0.3215961456298828, 0.4527986943721771, 0.3663005232810974, 0.5122056603431702, 0.3664957284927368]
推理时间: 17.46ms

=== 精度对比 ===
Cosine Similarity: 1.000000
Max Absolute Error: 0.001460
Relative Error: 0.000965

✓ NPU 适配通过

5. 精度校验

CPU 与 NPU 推理结果对比:

  • 余弦相似度:1.000000(> 0.99 通过)
  • 最大绝对误差:0.001460