liucu/timm-seresnext50_32x4d.gluon_in1k-NPU
模型介绍文件和版本Pull Requests讨论分析
下载使用量0

timm/seresnext50_32x4d.gluon_in1k on Ascend NPU

1. 简介

本项目将 timm/seresnext50_32x4d.gluon_in1k 图片分类模型适配到华为昇腾 NPU (Ascend910)。

  • 模型来源: ModelScope
  • 适配方式: timm.create_model(pretrained=False) + ModelScope 本地权重加载
  • 输入尺寸: 224x224
  • 类别数: 1000

2. 验证环境

项目版本/型号
NPUAscend910
CANN8.5.1
torch2.x
torch_npu对应 CANN 版本
timmlatest

3. 推理运行

pip install -r requirements.txt
python inference.py

推理结果 (NPU Top-5):

  • Top-1: class_473 (0.019539)
  • Top-2: class_512 (0.014463)
  • Top-3: class_902 (0.013660)
  • Top-4: class_600 (0.011041)
  • Top-5: class_623 (0.010946)

日志保存在 logs/inference.log。

4. 精度验证

对单张测试图片进行 CPU 与 NPU 一致性验证:

指标数值
max_abs_error0.004276
mean_abs_error0.000871
relative_error0.1186%
cosine_similarity0.999999
threshold1.0%
结果PASS
  • CPU Top-1: class_473
  • NPU Top-1: class_473
  • CPU Top-5: class_473, class_512, class_902, class_600, class_623
  • NPU Top-5: class_473, class_512, class_902, class_600, class_623
  • Top-1 match: True
  • Top-5 match: True

5. 性能参考

指标数值
iterations10
avg_latency_ms7.308
min_latency_ms7.194
max_latency_ms7.410
p50_latency_ms7.303
p90_latency_ms7.410
p95_latency_ms7.410
images_per_sec136.84

日志保存在 logs/benchmark.log。

6. 精度评测说明

本项目包含单图 smoke consistency 验证,非官方 ImageNet 完整验证集评测。详细指标见第 4 节。

7. 自验证截图

见 screenshots/self_verification.png。

8. 日志文件

  • logs/inference.log - 推理结果
  • logs/accuracy.log - 精度一致性验证
  • logs/benchmark.log - 性能基准测试

9. 注意事项

  • 权重通过 ModelScope snapshot_download 下载,严禁使用 HuggingFace 自动下载。
  • 推理时使用 timm.data.resolve_model_data_config 获取预处理参数,确保与训练一致。
  • 占位测试图片为纯灰色图,预测结果不具有语义意义,仅用于验证推理通路。

10. 标签

#NPU #Ascend #Ascend910 #timm #image-classification