Yolov5m inference results are different between GPU and NPU on IMX95

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Yolov5m inference results are different between GPU and NPU on IMX95

230 次查看
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?



标记 (1)
0 项奖励
回复
3 回复数

152 次查看
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 项奖励
回复

194 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @Tongshen 

Can you share the model you are using?

Best Regards,
Zhiming

0 项奖励
回复

191 次查看
Tongshen
Contributor II

Hey Zhiming,

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

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-2217139%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9C%A8%20IMX95%20%E4%B8%8A%EF%BC%8CGPU%20%E5%92%8C%20NPU%20%E7%9A%84%20Yolov5m%20%E6%8E%A8%E7%90%86%E7%BB%93%E6%9E%9C%E4%B8%8D%E5%90%8C%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2217139%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%98%BF%E6%81%A9%E6%99%BA%E6%B5%A6%EF%BC%8C%3CBR%20%2F%3E%3CBR%20%2F%3E%E6%88%91%E6%83%B3%E5%9C%A8%20IMX95%20NPU%20%E4%B8%AD%E9%83%A8%E7%BD%B2%20YoloV5M%EF%BC%8C%E6%88%91%E7%9A%84%E5%86%85%E6%A0%B8%E7%89%88%E6%9C%AC%E6%98%AF%EF%BC%9A%3CBR%20%2F%3ELinux%20%E7%89%88%E6%9C%AC%206.12.20-lts-next-gdfaf2136deb2%20(oe-user%20%3Ca%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F50695%22%3E%40OE%3C%2Fa%3E-host)%20(aarch64-%E5%8F%82%E8%80%83%E5%8F%91%E8%A1%8C%E7%89%88%E3%80%81%E7%B3%BB%E7%BB%9F%E5%BC%80%E5%8F%91%E5%A5%97%E4%BB%B6%E3%80%82-linux-gcc%20(GCC)%2014.2.0%EF%BC%8CGNU%20ld%20(GNU%20Binutils)%202.44)%231%20SMP%20PREEMPT%20Wed%20Jun%204%2010%3A15%3A09%20UTC%202025%3CBR%20%2F%3E%3CBR%20%2F%3E%E6%88%91%E4%BD%BF%E7%94%A8%20eIQ%20v1.16%20%E8%BD%AC%E6%8D%A2%E6%A8%A1%E5%9E%8B%EF%BC%8C%E4%BD%86%E6%8E%A8%E7%90%86%E7%BB%93%E6%9E%9C%E4%B8%8E%20GPU%20%E5%AE%8C%E5%85%A8%E4%B8%8D%E5%90%8C%E3%80%82%E6%8E%A8%E7%90%86%E7%AE%A1%E9%81%93%E4%B9%9F%E6%98%AF%E4%B8%80%E6%A0%B7%E7%9A%84%EF%BC%8C%E6%98%AF%E4%BB%8E%20label_image.py%20%E4%B8%AD%E4%BF%AE%E6%94%B9%E8%80%8C%E6%9D%A5%E3%80%82%3CBR%20%2F%3EGPU%20%E6%8E%A8%E6%96%AD%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%3E%E4%BB%8E%20%2Fusr%2Flib%2Flibneutron_delegate.so%20%E5%8A%A0%E8%BD%BD%E5%A4%96%E9%83%A8%E5%A7%94%E6%89%98%EF%BC%8C%E5%8F%82%E6%95%B0%E4%B8%BA%EF%BC%9A%20%7B%7D%3CBR%20%2F%3EINFO%EF%BC%9ANeutronDelegate%20%E5%A7%94%E6%89%98%EF%BC%9A335%20%E4%B8%AA%E8%8A%82%E7%82%B9%E4%B8%AD%E6%9C%89%200%20%E4%B8%AA%E8%8A%82%E7%82%B9%E8%A2%AB%E5%A7%94%E6%89%98%EF%BC%8C0%20%E4%B8%AA%E5%88%86%E5%8C%BA%E3%80%82%3C%2FP%3E%3CP%3Ecpuinfo%20%E4%B8%AD%E7%9A%84%E9%94%99%E8%AF%AF%EF%BC%9Aprctl(PR_SVE_GET_VL)%20%E5%A4%B1%E8%B4%A5%3CBR%20%2F%3EINFO%EF%BC%9A%3CBR%20%2F%3E%E4%BB%8E%20dms.txt%20%E5%8A%A0%E8%BD%BD%203%20%E4%B8%AA%E6%A0%87%E7%AD%BE%3CBR%20%2F%3E%E9%A2%84%E7%83%AD%E6%97%B6%E9%97%B4%EF%BC%9A641.2%20%E6%AF%AB%E7%A7%92%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%E5%A4%84%E7%90%86%EF%BC%9A%2Fusr%2Fbin%2Ftensorflow-lite-2.18.0%2Fexamples%2F1755631829_1.jpg%3CBR%20%2F%3E%E6%8E%A8%E6%96%AD%E6%97%B6%E9%97%B4%EF%BC%9A626.7%20ms%3CBR%20%2F%3E%5B14%205%5D%3CBR%20%2F%3ENMS%20%E5%90%8E%E7%9A%84%E6%A3%80%E6%B5%8B%EF%BC%9A1%3CBR%20%2F%3E%3CBR%20%2F%3ENPU%20%E6%8E%A8%E6%96%AD%EF%BC%9A%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%3E%E4%BB%8E%20%2Fusr%2Flib%2Flibneutron_delegate.so%20%E5%8A%A0%E8%BD%BD%E5%A4%96%E9%83%A8%E5%A7%94%E6%89%98%EF%BC%8C%E5%8F%82%E6%95%B0%E4%B8%BA%EF%BC%9A%20%7B%7D%3CBR%20%2F%3EINFO%EF%BC%9ANeutronDelegate%20%E5%A7%94%E6%89%98%EF%BC%9A61%20%E4%B8%AA%E8%8A%82%E7%82%B9%E4%B8%AD%E5%A7%94%E6%89%98%E4%BA%86%201%20%E4%B8%AA%E8%8A%82%E7%82%B9%EF%BC%8C%E6%9C%89%201%20%E4%B8%AA%E5%88%86%E5%8C%BA%E3%80%82%3C%2FP%3E%3CP%3EINFO%EF%BC%9ANeutron%20%E5%A7%94%E6%89%98%E7%89%88%E6%9C%AC%EF%BC%9Av1.0.0-a5d640e6%EF%BC%8C%E5%B7%B2%E5%90%AF%E7%94%A8%20zerocp%E3%80%82%3CBR%20%2F%3Ecpuinfo%20%E4%B8%AD%E7%9A%84%E9%94%99%E8%AF%AF%EF%BC%9Aprctl(PR_SVE_GET_VL)%20%E5%A4%B1%E8%B4%A5%3CBR%20%2F%3EINFO%EF%BC%9A%3CBR%20%2F%3E%E4%BB%8E%20dms.txt%20%E5%8A%A0%E8%BD%BD%203%20%E4%B8%AA%E6%A0%87%E7%AD%BE%3CBR%20%2F%3E%E9%A2%84%E7%83%AD%E6%97%B6%E9%97%B4%EF%BC%9A35.4%20%E6%AF%AB%E7%A7%92%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%E5%A4%84%E7%90%86%E4%B8%AD%EF%BC%9A%2Fusr%2Fbin%2Ftensorflow-lite-2.18.0%2Fexamples%2F1755631829_1.jpg%3CBR%20%2F%3E%E6%8E%A8%E6%96%AD%E6%97%B6%E9%97%B4%EF%BC%9A34.8%20ms%3CBR%20%2F%3ENMS%20%E4%B9%8B%E5%90%8E%E7%9A%84%E6%A3%80%E6%B5%8B%E7%BB%93%E6%9E%9C%EF%BC%9A1%3CBR%20%2F%3E%3CBR%20%2F%3E%E6%8E%A8%E8%AE%BA%E7%BB%93%E6%9E%9C%EF%BC%88%E5%8F%B3%E4%BE%A7%20NPU%20%E5%B7%A6%E4%BE%A7%20GPU%EF%BC%89%20%EF%BC%9A%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%3E%E6%82%A8%E8%83%BD%E8%A7%A3%E9%87%8A%E4%B8%80%E4%B8%8B%E4%B8%BA%E4%BB%80%E4%B9%88%20NPU%20%E4%BC%9A%E4%BA%A7%E7%94%9F%E6%9B%B4%E5%A4%9A%E7%9A%84%E7%9B%92%E5%AD%90%E5%90%97%EF%BC%9F%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%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%3CBR%20%2F%3E%3CBR%20%2F%3E%E6%88%91%E5%9C%A8L6.12.34%E4%B8%8A%E5%81%9A%E4%BA%86%E4%B8%80%E4%B8%AA%E6%B5%8B%E8%AF%95%EF%BC%8C%E8%BF%99%E4%B8%AA%E6%A8%A1%E5%9E%8B%E4%B9%9F%E6%98%AF%E4%BB%8E%E4%B8%AD%E5%AD%90%E5%8F%98%E6%B5%81%E5%99%A8%EF%BC%88L6.12.34%EF%BC%89%E8%BD%AC%E6%8D%A2%E8%80%8C%E6%9D%A5%E7%9A%84%E3%80%82%E8%AF%B7%E8%80%83%E8%99%91%E5%B0%86%E6%82%A8%E7%9A%84%E7%94%B5%E8%B7%AF%E6%9D%BF%E6%94%AF%E6%8C%81%E5%8C%85%E6%9B%B4%E6%96%B0%E5%88%B0%20L6.12.34%E3%80%82%E6%88%91%E5%B0%86%E4%B8%8E%E4%BD%A0%E4%BB%AC%E5%88%86%E4%BA%AB%E6%A8%A1%E5%9E%8B%E3%80%82%E5%9C%A8%20C%3A%5CNXP%5CeIQ_Toolkit_v1.17.0%5C%20bin%20%E4%B8%AD%E8%BF%90%E8%A1%8C%20neutron-%E5%8F%98%E6%B5%81%E5%99%A8.exe%5Cn%20eutron-%E5%8F%98%E6%B5%81%E5%99%A8%5C%20mcu_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%3ENPU%20%E7%9A%84%E7%BB%93%E6%9E%9C%E4%B8%8E%20CPU%20%E7%9B%B8%E5%90%8C%E3%80%82%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%3E%E8%87%B4%E6%95%AC%EF%BC%8C%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%3E%E5%98%BF%EF%BC%8CZhiming%EF%BC%8C%3CBR%20%2F%3E%3CBR%20%2F%3E%EF%BC%8C%E6%88%91%E6%97%A0%E6%B3%95%E5%9C%A8%E6%AD%A4%E6%8F%90%E4%BE%9B%E6%A8%A1%E5%9E%8B%E3%80%82%E6%82%A8%E4%BB%8B%E6%84%8F%E5%9C%A8%E8%BF%99%E9%87%8C%E5%88%86%E4%BA%AB%E6%82%A8%E7%9A%84%E7%94%B5%E5%AD%90%E9%82%AE%E4%BB%B6%E5%90%97%EF%BC%9F%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%3E%E6%82%A8%E5%A5%BD%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%20%3CBR%20%2F%3E%3CBR%20%2F%3E%EF%BC%8C%E8%83%BD%E5%90%A6%E5%88%86%E4%BA%AB%E4%B8%80%E4%B8%8B%E6%82%A8%E4%BD%BF%E7%94%A8%E7%9A%84%E6%A8%A1%E5%9E%8B%EF%BC%9F%3CBR%20%2F%3E%3CBR%20%2F%3E%E8%87%B4%E6%95%AC%EF%BC%8C%3CBR%20%2F%3EZhiming%3C%2FP%3E%3C%2FLINGO-BODY%3E