Repository navigation
Commit a78b4da
authored
Zephyr: report the host reference label alongside the top-5 (pytorch#23353)
`gen_input.py` writes `MV2_HOST_TOP1` and `MV2_HOST_LABEL` into
`mv2_input.h`, but nothing reads them. The sample prints bare class IDs,
so a reader cannot interpret the output on target without an ImageNet
label table.
This prints the recorded host prediction after the top-5 and states
whether the device top-1 agrees:
```
Top-5 predictions:
[1] class 258: 6.1895
[2] class 259: 4.8418
[3] class 261: 3.4442
host float32 reference: class 258 (Samoyed) -> device top-1 MATCHES
```
Guarded on both defines, so headers generated before pytorch#23300 still build.
No label table is added to the target; the single string already comes
from the generated header.
## Verification
Flashed and run on an Alif Ensemble E8 DevKit (Cortex-M55 HP at 400 MHz
+ Ethos-U55, 256 MAC) with Zephyr 4.4.0 and Zephyr SDK 1.0.1, using a
photograph prepared by `gen_input.py` and an INT8 model calibrated on
250 ImageNet photos. Inference completed in 28 ms and the device top-1
matched the float32 torchvision reference.
Flash cost is 160 bytes.
Authored with Claude.1 parent 305638c commit a78b4da
1 file changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
272 | 283 | | |
273 | 284 | | |
274 | 285 | | |
| |||
0 commit comments