w
gcw_uQ09W7jl/timm-regnety_008_tv.tv2_in1k-NPU
模型介绍文件和版本Pull Requests讨论分析
下载使用量0

timm/regnety_008_tv.tv2_in1k on Ascend NPU

1. 简介

本项目将 timm/regnety_008_tv.tv2_in1k 图像分类模型适配到单卡昇腾 NPU (Ascend910) 上运行。

模型类型:图像分类 (ImageNet-1k, 1000 classes) 架构:RegNetY-008 (by timm)

2. 验证环境

项目版本
NPUAscend910
CANN8.5.1
PyTorch2.9.0+cpu
torch_npu与 CANN 8.5.1 配套
timmlatest

环境检查日志:logs/env_check.log

3. 推理运行

pip install -r requirements.txt
python inference.py

推理结果 (NPU):

Model: timm/regnety_008_tv.tv2_in1k
Input source: assets/test.jpg
Output shape: torch.Size([1, 1000])
Top-5 predictions:
  1. class=576, prob=0.1773
  2. class=682, prob=0.0633
  3. class=698, prob=0.0423
  4. class=624, prob=0.0343
  5. class=517, prob=0.0260

日志保存在 logs/inference.log。

4. 精度验证

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

指标数值
max_abs_error0.005747
mean_abs_error0.000760
relative_error0.1406%
cosine_similarity0.999999
threshold1.0%
结果PASS

5. 性能参考

指标数值
avg_latency7.77 ms
min_latency7.33 ms
max_latency7.98 ms
p50_latency7.89 ms
p90_latency7.96 ms
p95_latency7.97 ms
throughput128.66 samples/s

注:性能数据在单卡 Ascend910 上测得,实际数值可能因负载、温度、驱动版本而波动。

6. 精度评测说明

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

7. 自验证截图

  • 文本摘要:screenshots/self_verification.txt
  • 截图:screenshots/self_verification.png

8. 日志文件

文件说明
logs/env_check.logNPU 环境检查
logs/inference.logNPU 推理输出
logs/accuracy.logCPU-NPU 精度一致性
logs/benchmark.logNPU 性能基准测试

9. 注意事项

  • 权重通过 ModelScope snapshot_download 自动下载到本地缓存,首次运行需要联网。
  • 推理脚本使用 pretrained=False + 本地 safetensors 权重加载,不依赖 HuggingFace 自动下载。
  • 测试图片下载失败时会使用占位灰度图,预测结果仅供演示。

10. 标签

#NPU #Ascend #Ascend910 #ImageClassification #timm