本项目将 timm/tf_efficientnet_lite1.in1k 图片分类模型适配到华为昇腾 NPU (Ascend910) 单卡环境。使用 ModelScope snapshot_download 下载权重,通过 timm.create_model(pretrained=False) 加载本地权重,不依赖 HuggingFace 直连。
cd timm-tf_efficientnet_lite1.in1k-NPU
pip install -r requirements.txt
python inference.py推理结果 (NPU Top-5):
对单张测试图片进行 CPU 与 NPU 一致性验证:
| 指标 | 数值 |
|---|---|
| max_abs_error | 0.000379 |
| mean_abs_error | 0.000088 |
| relative_error | 0.2726% |
| cosine_similarity | 0.999998 |
| threshold | 1.0% |
| 结果 | PASS |
| 指标 | 数值 |
|---|---|
| avg latency | 6.72 ms |
| min latency | 6.68 ms |
| max latency | 6.78 ms |
| p50 latency | 6.72 ms |
| p90 latency | 6.77 ms |
| p95 latency | 6.77 ms |
| throughput | 148.81 images/sec |
本项目包含单图 smoke consistency 验证,非官方 ImageNet 完整验证集评测。详细指标见第 4 节。
详见 screenshots/self_verification.png
logs/inference.log — 推理结果日志logs/accuracy.log — 精度验证日志logs/benchmark.log — 性能基准测试日志timm.create_model(pretrained=False) + 本地权重加载.bin, .safetensors, .pth, .pt, .ckpt, .onnx)