将 timm 图片分类模型 timm/dpn68.mx_in1k 适配为可在单卡昇腾 NPU(Ascend910B)上运行的提交工程。
DPN-68(Dual Path Network)是一种高效的卷积神经网络架构,通过结合 DenseNet 和 ResNet 的优点来提升特征复用效率。本项目使用 ModelScope snapshot_download 下载权重,timm.create_model(pretrained=False) 创建模型结构并加载本地权重。
requirements.txtpython inference.py推理结果(Top-5):
对单张测试图片进行 CPU 与 NPU 一致性验证:
| 指标 | 数值 |
|---|---|
| max_abs_error | 0.019123 |
| mean_abs_error | 0.003676 |
| relative_error | 0.2390% |
| cosine_similarity | 0.999997 |
| threshold | 1.0% |
| 结果 | PASS |
| 指标 | 数值 |
|---|---|
| avg_latency_ms | 9.575 |
| min_latency_ms | 9.381 |
| max_latency_ms | 9.707 |
| p50_ms | 9.584 |
| p90_ms | 9.706 |
| p95_ms | 9.707 |
| images_per_sec | 104.43 |
测试条件:warmup 2 次 + 正式 10 次,每次前后调用 torch.npu.synchronize()。
本项目包含单图 smoke consistency 验证,非官方 ImageNet 完整验证集评测。详细指标见第 4 节。
见 screenshots/self_verification.png。
logs/inference.log:推理结果logs/accuracy.log:精度一致性验证logs/benchmark.log:性能基准测试logs/env_check.log:环境检查#NPU #Ascend #DPN #ImageClassification #timm