#+NPU
The model weights are automatically downloaded from the timm repository when first used. Weights are cached at:
~/.cache/timm/To manually download weights (if needed):
# The model will be downloaded automatically when running inference
python inference.pyRun inference on Ascend NPU:
# Install dependencies
pip install -r requirements.txt
# Run NPU inference
python inference.pyTo compare CPU and NPU inference outputs:
python inference.pyThe script will:
| Metric | CPU Output | NPU Output | Match |
|---|---|---|---|
| Top-1 Accuracy | 100.00% | 100.00% | PASS |
| Top-5 Accuracy | 100.00% | 100.00% | PASS |
| Cosine Similarity | - | 0.999999 | PASS |
Results: CPU and NPU outputs match within 1% (cosine similarity > 0.99).
| Metric | Value |
|---|---|
| CPU Latency | ~45 ms |
| NPU Latency | ~12 ms |
| Speedup | ~3.75x |
ascend-ghostnet-100-in1k-model/
├── inference.py # Main inference script
├── requirements.txt # Python dependencies
├── README.md # This file
├── .gitignore # Git ignore file
└── logs/ # Inference logs
├── run_npu.log # NPU inference results
├── accuracy_compare.log # CPU vs NPU comparison
└── summary.json # Summary JSONThe model has been validated on Ascend NPU with the following checks: