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

timm-swin_large_patch4_window12_384.ms_in22k_ft_in1k - 昇腾 NPU 适配

1. 模型信息

  • 模型: timm-swin_large_patch4_window12_384.ms_in22k_ft_in1k
  • 来源: timm
  • 任务: ImageNet 图像分类
  • 分辨率: 384x384

2. 昇腾 NPU 适配结果

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

3. 推理脚本

python3 inference.py

4. 推理输出证据

=== swin_large_patch4_window12_384.ms_in22k_ft_in1k ===
Dtype: torch.float32
Resolution: 384

--- CPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [0.4201171100139618, 0.5023985505104065, 0.44463610649108887, 0.44674602150917053, 0.4419211447238922]
推理时间: 1278.73ms

--- NPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [0.4196116030216217, 0.5023404359817505, 0.44433262944221497, 0.4463307857513428, 0.44152379035949707]
推理时间: 17.36ms

=== 精度对比 ===
Cosine Similarity: 1.000000
Max Absolute Error: 0.001630
Relative Error: 0.000934

✓ NPU 适配通过

5. 精度校验

CPU 与 NPU 推理结果对比:

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