本项目将 timm/tf_efficientnet_lite1.in1k 适配到华为昇腾 NPU (Ascend910B) 上运行。
使用 ModelScope snapshot_download 下载权重,timm.create_model(pretrained=False) 加载本地权重。
python inference.py推理结果示例(单张测试图片):
| Rank | Class | Probability |
|---|---|---|
| 1 | class_958 | 0.1301 |
| 2 | class_649 | 0.0597 |
| 3 | class_975 | 0.03 |
| 4 | class_912 | 0.0263 |
| 5 | class_978 | 0.0262 |
对单张测试图片进行 CPU 与 NPU 一致性验证:
| 指标 | 数值 |
|---|---|
| max_abs_error | 0.005384 |
| mean_abs_error | 0.00126 |
| relative_error | 0.1488% |
| cosine_similarity | 0.999999 |
| threshold | 1.0% |
| 结果 | PASS |
| 指标 | 数值 |
|---|---|
| 平均延迟 | 14.1 ms |
| 吞吐量 | 70.9 images/sec |
本项目包含单图 smoke consistency 验证,非官方 ImageNet 完整验证集评测。
logs/inference.loglogs/accuracy.loglogs/benchmark.log| 项目 | 链接 |
|---|---|
| 原始权重模型地址 | https://modelscope.cn/models/timm/tf_efficientnet_lite1.in1k |
| 提交项目地址 | https://gitcode.com/v50_/timm-tf_efficientnet_lite1.in1k-NPU |
提交说明: 适配 timm/tf_efficientnet_lite1.in1k 到昇腾 NPU (Ascend910)。使用 ModelScope snapshot_download 下载权重,timm.create_model(pretrained=False) 加载本地权重,包含推理验证、CPU-NPU 精度一致性检查和性能基准测试。精度: PASS (relative_error=0.1488%)。吞吐量: 70.9 images/sec
#NPU