| 指标 | 值 |
|---|---|
| 设备 | Ascend 910B4 |
| 精度 | float32 |
| Cosine Similarity | 0.999999 |
| Max Absolute Error | 0.006553 |
| NPU 推理时间 | 8.96ms |
python3 inference.py
=== ghostnet_100.in1k ===
Dtype: torch.float32
--- CPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [-0.7105944156646729, -0.0036331184674054384, -0.7227957844734192, 0.3264969289302826, 0.9221805334091187]
推理时间: 108.57ms
--- NPU 推理 ---
输出形状: torch.Size([1, 1000])
输出前5值: [-0.709502100944519, -0.004014733713120222, -0.7219572067260742, 0.3267768919467926, 0.9221465587615967]
推理时间: 8.96ms
=== 精度对比 ===
Cosine Similarity: 0.999999
Max Absolute Error: 0.006553
Relative Error: 0.005109
✓ NPU 适配通过CPU 与 NPU 推理结果对比:
# 安装依赖
pip install torch torch_npu timm huggingface_hub safetensors
# 运行推理
python3 inference.py本适配由 vision-encoder-npu-adapt Agent Skill 自动完成,包含: