本项目将 Genius-Society/HEp2 模型适配到昇腾 NPU (Ascend910B) 上运行。
| 项目 | 版本/信息 |
|---|---|
| NPU 驱动 | npu-smi 25.5.2 |
| NPU 设备 | Ascend910_9362 |
| Python | 3.11.14 |
| PyTorch | (环境自带) |
| torch_npu | (环境自带) |
NPU 健康状态: OK
pip install -r requirements.txt
python inference.py推理结果 (NPU Top-5):
完整推理日志 (logs/inference.log):
=== Genius-Society/HEp2 NPU Inference ===
Model: Genius-Society/HEp2
Loader type: torchvision
Input shape: torch.Size([1, 3, 224, 224])
Output shape: torch.Size([1, 6])
Num classes: 6
NPU Top-5 Predictions:
Top-1: Speckled (0.995100)
Top-2: Centromere (0.004899)
Top-3: Homogeneous (0.000001)
Top-4: Nucleolar (0.000000)
Top-5: Golgi (0.000000)
All class probabilities:
Centromere: 0.004899
Golgi: 0.000000
Homogeneous: 0.000001
NuMem: 0.000000
Nucleolar: 0.000000
Speckled: 0.995100对单张测试图片进行 CPU 与 NPU 一致性验证:
| 指标 | 数值 |
|---|---|
| max_abs_error | 0.000032 |
| mean_abs_error | 0.000011 |
| relative_error | 0.1904% |
| cosine_similarity | 1.000000 |
| threshold | 1.0% |
| 结果 | PASS |
| 指标 | 数值 |
|---|---|
| avg latency | 0.9001 ms |
| min latency | 0.8802 ms |
| max latency | 0.9575 ms |
| p50 latency | 0.8933 ms |
| p90 latency | 0.9575 ms |
| p95 latency | 0.9575 ms |
| images/sec | 1110.95 |
测试配置: warmup 2 次 + 正式 10 次,单卡 NPU。
本项目包含单图 smoke consistency 验证,非官方完整验证集评测。详细指标见第 4 节。
见 screenshots/self_verification.png。
| 日志 | 说明 |
|---|---|
logs/inference.log | NPU 推理输出 |
logs/accuracy.log | CPU-NPU 精度一致性 |
logs/benchmark.log | NPU 性能基准测试 |
snapshot_download 下载,不提交到仓库。#NPU #Ascend #Ascend910 #AlexNet #ImageClassification #MedicalImaging #HEp2