本项目将 timm/regnety_320.tv2_in1k 图片分类模型适配到华为昇腾 NPU (Ascend910)。使用 ModelScope snapshot_download 下载权重,timm.create_model(pretrained=False) 加载本地权重,包含推理验证、CPU-NPU 精度一致性检查和性能基准测试。
python inference.py推理结果(Top-5):
对单张测试图片进行 CPU 与 NPU 一致性验证:
| 指标 | 数值 |
|---|---|
| max_abs_error | 0.000562 |
| mean_abs_error | 0.000097 |
| relative_error | 0.0158% |
| cosine_similarity | 1.000000 |
| threshold | 1.0% |
| 结果 | PASS |
| 指标 | 数值 |
|---|---|
| Avg latency | 11.63 ms |
| Min latency | 11.59 ms |
| Max latency | 11.66 ms |
| P50 latency | 11.63 ms |
| P90 latency | 11.65 ms |
| P95 latency | 11.66 ms |
| Throughput | 86.02 images/sec |
本项目包含单图 smoke consistency 验证,非官方 ImageNet 完整验证集评测。详细指标见第 4 节。
请参阅 screenshots/ 目录。
logs/inference.log - 推理日志logs/accuracy.log - 精度验证日志logs/benchmark.log - 性能基准日志pretrained=False + ModelScope 本地权重加载#NPU #Ascend #Ascend910 #ImageClassification #RegNet