IMX95 npu

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

IMX95 npu

487 Views
shiva141
Contributor II

Dear NXP Support Team,

I am currently working with the NXP i.MX95 SoC using the following setup:

SoC: i.MX95

OS: Yocto 6.6 (Scarthgap)

# uname -a
Linux imx95 6.6.52

Reference Document: Machine Learning User Guide (UG10166.pdf)

I have followed the steps outlined in the user guide. I am able to successfully execute the benchmark commands for CPU, GPU, and NPU, and the benchmarking results are generated as expected.

However, we are facing an issue with the image classification NPU example using label_image.

Location:

/usr/bin/tensorflow-lite-2.16.2/examples
CPU Execution (Working as Expected)

Command:

./label_image -m mobilenet_v1_1.0_224_quant.tflite -i grace_hopper.bmp -l labels.txt

Output:

INFO: Loaded model mobilenet_v1_1.0_224_quant.tflite
INFO: resolved reporter
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
INFO: invoked
INFO: average time: 12.897 ms
INFO: 0.768627: 653 military uniform
INFO: 0.105882: 907 Windsor tie
INFO: 0.0196078: 458 bow tie
INFO: 0.0117647: 466 bulletproof vest
INFO: 0.00784314: 835 suit

The classification results are correct.

NPU Execution (Issue Observed)

Command:

./label_image -m mobilenet_v1_1.0_224_quant.tflite -i grace_hopper.bmp -l labels.txt \
--external_delegate_path=/usr/lib/libneutron_delegate.so

Output:

INFO: Loaded model mobilenet_v1_1.0_224_quant.tflite
INFO: resolved reporter
INFO: EXTERNAL delegate created.
INFO: NeutronDelegate delegate: 29 nodes delegated out of 31 nodes with 1 partitions.
INFO: Applied EXTERNAL delegate.
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
INFO: invoked
INFO: average time: 0.207 ms



Observation:

The delegate reports that 29 out of 31 nodes are delegated.

However, no image classification results are printed during NPU execution.

The reported inference time (~0.207 ms) appears unusually low compared to expected NPU execution time.

In contrast, CPU execution produces correct classification output.



Could you please advise if this behavior is expected for Yocto 6.6 (Scarthgap)

share steps for  Image calassifcation demo using NPU in 6.6.52 

iMX95 #NPU

Labels (1)
0 Kudos
Reply
1 Reply

444 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi @shiva141 

Continue in SFDC.

Best Regards,
Zhiming

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2325561%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EIMX95%20npu%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2325561%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EDear%20NXP%20Support%20Team%2C%3C%2FP%3E%3CP%3EI%20am%20currently%20working%20with%20the%20NXP%20i.MX95%20SoC%20using%20the%20following%20setup%3A%3C%2FP%3E%3CP%3ESoC%3A%20i.MX95%3C%2FP%3E%3CP%3EOS%3A%20Yocto%206.6%20(Scarthgap)%3C%2FP%3E%3CP%3E%23%20uname%20-a%3CBR%20%2F%3ELinux%20imx95%206.6.52%3CBR%20%2F%3E%3CBR%20%2F%3EReference%20Document%3A%20Machine%20Learning%20User%20Guide%20(UG10166.pdf)%3C%2FP%3E%3CP%3EI%20have%20followed%20the%20steps%20outlined%20in%20the%20user%20guide.%20I%20am%20able%20to%20successfully%20execute%20the%20benchmark%20commands%20for%20CPU%2C%20GPU%2C%20and%20NPU%2C%20and%20the%20benchmarking%20results%20are%20generated%20as%20expected.%3C%2FP%3E%3CP%3EHowever%2C%20we%20are%20facing%20an%20issue%20with%20the%20image%20classification%20NPU%20example%20using%20label_image.%3C%2FP%3E%3CP%3ELocation%3A%3C%2FP%3E%3CP%3E%2Fusr%2Fbin%2Ftensorflow-lite-2.16.2%2Fexamples%3CBR%20%2F%3ECPU%20Execution%20(Working%20as%20Expected)%3C%2FP%3E%3CP%3ECommand%3A%3C%2FP%3E%3CP%3E.%2Flabel_image%20-m%20mobilenet_v1_1.0_224_quant.tflite%20-i%20grace_hopper.bmp%20-l%20labels.txt%3C%2FP%3E%3CP%3EOutput%3A%3C%2FP%3E%3CP%3EINFO%3A%20Loaded%20model%20mobilenet_v1_1.0_224_quant.tflite%3CBR%20%2F%3EINFO%3A%20resolved%20reporter%3CBR%20%2F%3EINFO%3A%20Created%20TensorFlow%20Lite%20XNNPACK%20delegate%20for%20CPU.%3CBR%20%2F%3EINFO%3A%20invoked%3CBR%20%2F%3EINFO%3A%20average%20time%3A%2012.897%20ms%3CBR%20%2F%3EINFO%3A%200.768627%3A%20653%20military%20uniform%3CBR%20%2F%3EINFO%3A%200.105882%3A%20907%20Windsor%20tie%3CBR%20%2F%3EINFO%3A%200.0196078%3A%20458%20bow%20tie%3CBR%20%2F%3EINFO%3A%200.0117647%3A%20466%20bulletproof%20vest%3CBR%20%2F%3EINFO%3A%200.00784314%3A%20835%20suit%3C%2FP%3E%3CP%3EThe%20classification%20results%20are%20correct.%3C%2FP%3E%3CP%3ENPU%20Execution%20(Issue%20Observed)%3C%2FP%3E%3CP%3ECommand%3A%3C%2FP%3E%3CP%3E.%2Flabel_image%20-m%20mobilenet_v1_1.0_224_quant.tflite%20-i%20grace_hopper.bmp%20-l%20labels.txt%20%5C%3CBR%20%2F%3E--external_delegate_path%3D%2Fusr%2Flib%2Flibneutron_delegate.so%3C%2FP%3E%3CP%3EOutput%3A%3C%2FP%3E%3CP%3EINFO%3A%20Loaded%20model%20mobilenet_v1_1.0_224_quant.tflite%3CBR%20%2F%3EINFO%3A%20resolved%20reporter%3CBR%20%2F%3EINFO%3A%20EXTERNAL%20delegate%20created.%3CBR%20%2F%3EINFO%3A%20NeutronDelegate%20delegate%3A%2029%20nodes%20delegated%20out%20of%2031%20nodes%20with%201%20partitions.%3CBR%20%2F%3EINFO%3A%20Applied%20EXTERNAL%20delegate.%3CBR%20%2F%3EINFO%3A%20Created%20TensorFlow%20Lite%20XNNPACK%20delegate%20for%20CPU.%3CBR%20%2F%3EINFO%3A%20invoked%3CBR%20%2F%3EINFO%3A%20average%20time%3A%200.207%20ms%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EObservation%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EThe%20delegate%20reports%20that%2029%20out%20of%2031%20nodes%20are%20delegated.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EHowever%2C%20no%20image%20classification%20results%20are%20printed%20during%20NPU%20execution.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20reported%20inference%20time%20(~0.207%20ms)%20appears%20unusually%20low%20compared%20to%20expected%20NPU%20execution%20time.%3CBR%20%2F%3E%3CBR%20%2F%3EIn%20contrast%2C%20CPU%20execution%20produces%20correct%20classification%20output.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3ECould%20you%20please%20advise%20if%20this%20behavior%20is%20expected%20for%20Yocto%206.6%20(Scarthgap)%3CBR%20%2F%3E%3CBR%20%2F%3Eshare%20steps%20for%26nbsp%3B%20Image%20calassifcation%20demo%20using%20NPU%20in%206.6.52%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fc-pwmxy87654%2FiMX95%2Fpd-p%2FiMX95%22%20class%3D%22lia-product-mention%22%20data-product%3D%22523-1%22%20target%3D%22_blank%22%3EiMX95%3C%2FA%3E%26nbsp%3B%23NPU%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2325561%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3ENPU%7CML%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2326641%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20IMX95%20npu%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2326641%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%2F230279%22%20target%3D%22_blank%22%3E%40shiva141%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EContinue%20in%20SFDC.%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3EZhiming%3C%2FP%3E%3C%2FLINGO-BODY%3E