Yolov5m inference results are different between GPU and NPU on IMX95

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Yolov5m inference results are different between GPU and NPU on IMX95

224 Views
Tongshen
Contributor II

Hey NXP,

I am trying to deploy a Yolov5m into IMX95 NPU, my kernel version is:
Linux version 6.12.20-lts-next-gdfaf2136deb2 (oe-user@oe-host) (aarch64-poky-linux-gcc (GCC) 14.2.0, GNU ld (GNU Binutils) 2.44) #1 SMP PREEMPT Wed Jun 4 10:15:09 UTC 2025

I used eIQ v1.16 to convert the model, but the inference result is totally different compared to the GPU. The inference pipeline is the same, which is modified from label_image.py.
GPU inference:

root@imx95-19x19-verdin:/usr/bin/tensorflow-lite-2.18.0/examples# python3 dms_demo.py -e /usr/lib/libneutron_delegate.so
Loading external delegate from /usr/lib/libneutron_delegate.so with args: {}
INFO: NeutronDelegate delegate: 0 nodes delegated out of 335 nodes with 0 partitions.

Error in cpuinfo: prctl(PR_SVE_GET_VL) failed
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Loaded 3 labels from dms.txt
Warm-up time: 641.2 ms


Processing: /usr/bin/tensorflow-lite-2.18.0/examples/1755631829_1.jpg
Inference time: 626.7 ms
[14 5]
Detections after NMS: 1

NPU inference:

root@imx95-19x19-verdin:/usr/bin/tensorflow-lite-2.18.0/examples# python3 dms_demo.py -e /usr/lib/libneutron_delegate.so
Loading external delegate from /usr/lib/libneutron_delegate.so with args: {}
INFO: NeutronDelegate delegate: 1 nodes delegated out of 61 nodes with 1 partitions.

INFO: Neutron delegate version: v1.0.0-a5d640e6, zerocp enabled.
Error in cpuinfo: prctl(PR_SVE_GET_VL) failed
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Loaded 3 labels from dms.txt
Warm-up time: 35.4 ms


Processing: /usr/bin/tensorflow-lite-2.18.0/examples/1755631829_1.jpg
Inference time: 34.8 ms
Detections after NMS: 1

The inference result (right NPU left GPU) :

 

IMG_6090.jpg



Could you explain why the NPU generates more boxes?



Tags (1)
0 Kudos
Reply
3 Replies

146 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi,

I did a test on L6.12.34, the model also converted from neutron converter (L6.12.34). Please  consider update your BSP to L6.12.34. I will share model to you. Run neutron-converter.exe in C:\NXP\eIQ_Toolkit_v1.17.0\bin\neutron-converter\MCU_SDK_25.09.00+Linux_6.12.34_2.1.0/

Zhiming_Liu_0-1763685996441.png

The NPU result is same as CPU.

Zhiming_Liu_1-1763686167870.png
Best Regards,
Zhiming

0 Kudos
Reply

188 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @Tongshen 

Can you share the model you are using?

Best Regards,
Zhiming

0 Kudos
Reply

185 Views
Tongshen
Contributor II

Hey Zhiming,

I cannot provide the model here. Would you mind sharing your email here?

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2217139%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EYolov5m%20inference%20results%20are%20different%20between%20GPU%20and%20NPU%20on%20IMX95%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2217139%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHey%20NXP%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI%20am%20trying%20to%20deploy%20a%20Yolov5m%20into%20IMX95%20NPU%2C%20my%20kernel%20version%20is%3A%3CBR%20%2F%3ELinux%20version%206.12.20-lts-next-gdfaf2136deb2%20(oe-user%40oe-host)%20(aarch64-poky-linux-gcc%20(GCC)%2014.2.0%2C%20GNU%20ld%20(GNU%20Binutils)%202.44)%20%231%20SMP%20PREEMPT%20Wed%20Jun%204%2010%3A15%3A09%20UTC%202025%3CBR%20%2F%3E%3CBR%20%2F%3EI%20used%20eIQ%20v1.16%20to%20convert%20the%20model%2C%20but%20the%20inference%20result%20is%20totally%20different%20compared%20to%20the%20GPU.%20The%20inference%20pipeline%20is%20the%20same%2C%20which%20is%20modified%20from%20label_image.py.%3CBR%20%2F%3EGPU%20inference%3A%3C%2FP%3E%3CP%3Eroot%40imx95-19x19-verdin%3A%2Fusr%2Fbin%2Ftensorflow-lite-2.18.0%2Fexamples%23%20python3%20dms_demo.py%20-e%20%2Fusr%2Flib%2Flibneutron_delegate.so%3CBR%20%2F%3ELoading%20external%20delegate%20from%20%2Fusr%2Flib%2Flibneutron_delegate.so%20with%20args%3A%20%7B%7D%3CBR%20%2F%3EINFO%3A%20NeutronDelegate%20delegate%3A%200%20nodes%20delegated%20out%20of%20335%20nodes%20with%200%20partitions.%3C%2FP%3E%3CP%3EError%20in%20cpuinfo%3A%20prctl(PR_SVE_GET_VL)%20failed%3CBR%20%2F%3EINFO%3A%20Created%20TensorFlow%20Lite%20XNNPACK%20delegate%20for%20CPU.%3CBR%20%2F%3ELoaded%203%20labels%20from%20dms.txt%3CBR%20%2F%3EWarm-up%20time%3A%20641.2%20ms%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EProcessing%3A%20%2Fusr%2Fbin%2Ftensorflow-lite-2.18.0%2Fexamples%2F1755631829_1.jpg%3CBR%20%2F%3EInference%20time%3A%20626.7%20ms%3CBR%20%2F%3E%5B14%205%5D%3CBR%20%2F%3EDetections%20after%20NMS%3A%201%3CBR%20%2F%3E%3CBR%20%2F%3ENPU%20inference%3A%3C%2FP%3E%3CP%3Eroot%40imx95-19x19-verdin%3A%2Fusr%2Fbin%2Ftensorflow-lite-2.18.0%2Fexamples%23%20python3%20dms_demo.py%20-e%20%2Fusr%2Flib%2Flibneutron_delegate.so%3CBR%20%2F%3ELoading%20external%20delegate%20from%20%2Fusr%2Flib%2Flibneutron_delegate.so%20with%20args%3A%20%7B%7D%3CBR%20%2F%3EINFO%3A%20NeutronDelegate%20delegate%3A%201%20nodes%20delegated%20out%20of%2061%20nodes%20with%201%20partitions.%3C%2FP%3E%3CP%3EINFO%3A%20Neutron%20delegate%20version%3A%20v1.0.0-a5d640e6%2C%20zerocp%20enabled.%3CBR%20%2F%3EError%20in%20cpuinfo%3A%20prctl(PR_SVE_GET_VL)%20failed%3CBR%20%2F%3EINFO%3A%20Created%20TensorFlow%20Lite%20XNNPACK%20delegate%20for%20CPU.%3CBR%20%2F%3ELoaded%203%20labels%20from%20dms.txt%3CBR%20%2F%3EWarm-up%20time%3A%2035.4%20ms%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EProcessing%3A%20%2Fusr%2Fbin%2Ftensorflow-lite-2.18.0%2Fexamples%2F1755631829_1.jpg%3CBR%20%2F%3EInference%20time%3A%2034.8%20ms%3CBR%20%2F%3EDetections%20after%20NMS%3A%201%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20inference%20result%20(right%20NPU%20left%20GPU)%20%3A%3C%2FP%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22IMG_6090.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22IMG_6090.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F366547iB9E23A026FB2B306%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22IMG_6090.jpg%22%20alt%3D%22IMG_6090.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3ECould%20you%20explain%20why%20the%20NPU%20generates%20more%20boxes%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2228806%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Yolov5m%20inference%20results%20are%20different%20between%20GPU%20and%20NPU%20on%20IMX95%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2228806%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI%20did%20a%20test%20on%20L6.12.34%2C%20the%20model%20also%20converted%20from%20neutron%20converter%20(L6.12.34).%20Please%26nbsp%3B%20consider%20update%20your%20BSP%20to%20L6.12.34.%20I%20will%20share%20model%20to%20you.%20Run%20neutron-converter.exe%20in%26nbsp%3BC%3A%5CNXP%5CeIQ_Toolkit_v1.17.0%5Cbin%5Cneutron-converter%5CMCU_SDK_25.09.00%2BLinux_6.12.34_2.1.0%2F%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Zhiming_Liu_0-1763685996441.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Zhiming_Liu_0-1763685996441.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F366713iC906A9B8D036DF68%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Zhiming_Liu_0-1763685996441.png%22%20alt%3D%22Zhiming_Liu_0-1763685996441.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20NPU%20result%20is%20same%20as%20CPU.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Zhiming_Liu_1-1763686167870.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Zhiming_Liu_1-1763686167870.png%22%20style%3D%22width%3A%20383px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F366714iC633A7571DEADA69%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Zhiming_Liu_1-1763686167870.png%22%20alt%3D%22Zhiming_Liu_1-1763686167870.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3EZhiming%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2217324%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Yolov5m%20inference%20results%20are%20different%20between%20GPU%20and%20NPU%20on%20IMX95%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2217324%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHey%20Zhiming%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI%20cannot%20provide%20the%20model%20here.%20Would%20you%20mind%20sharing%20your%20email%20here%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2217301%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Yolov5m%20inference%20results%20are%20different%20between%20GPU%20and%20NPU%20on%20IMX95%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2217301%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F256505%22%20target%3D%22_blank%22%3E%40Tongshen%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3ECan%20you%20share%20the%20model%20you%20are%20using%3F%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3EZhiming%3C%2FP%3E%3C%2FLINGO-BODY%3E