This question has already been asked on this forum in 2020 and in 2021 concerning previous versions of the OS and demo software but the linked conversations do not propose a solution.
I am following the i.MX Machine Learning User's Guide and trying to run the Tensorflow Lite "label_image" example using the GPU.
My setup is :
- An i.MX 8M EVK Board
- The official Yocto image "imx-image-full-imx8mqevk.wic", version 5.15.5-1.0.0
Running label_image on the CPU gives the following result:
root@imx8mqevk:/usr/bin/tensorflow-lite-2.6.0/examples# ./label_image -m mobilenet_v1_1.0_224_quant.tflite -i grace_hopper.bmp -l labels.txt
INFO: Loaded model mobilenet_v1_1.0_224_quant.tflite
INFO: resolved reporter
INFO: invoked
INFO: average time: 49.08 ms
INFO: 0.764706: 653 military uniform
INFO: 0.121569: 907 Windsor tie
INFO: 0.0156863: 458 bow tie
INFO: 0.0117647: 466 bulletproof vest
INFO: 0.00784314: 835 suit
Attempting to use the GPU gives a longer inference time. I'm assuming that it fails and falls back to the CPU.
Using the option "--use_nnapi":
root@imx8mqevk:/usr/bin/tensorflow-lite-2.6.0/examples# ./label_image -m mobilenet_v1_1.0_224_quant.tflite -i grace_hopper.bmp -l labels.txt --use_nnapi=true
INFO: Loaded model mobilenet_v1_1.0_224_quant.tflite
INFO: resolved reporter
INFO: Created TensorFlow Lite delegate for NNAPI.
NNAPI delegate created.
INFO: Applied NNAPI delegate.
W [query_hardware_caps:71]Unsupported evis version
INFO: invoked
INFO: average time: 102.578 ms
INFO: 0.784314: 653 military uniform
INFO: 0.105882: 907 Windsor tie
INFO: 0.0156863: 458 bow tie
INFO: 0.00784314: 466 bulletproof vest
INFO: 0.00392157: 835 suit
Using the "libvx" delegate:
root@imx8mqevk:/usr/bin/tensorflow-lite-2.6.0/examples# ./label_image -m mobilenet_v1_1.0_224_quant.tflite -i grace_hopper.bmp -l labels.txt --external_delegate_path=/usr/lib/libvx_delegate.so
INFO: Loaded model mobilenet_v1_1.0_224_quant.tflite
INFO: resolved reporter
Vx delegate: allowed_builtin_code set to 0.
Vx delegate: error_during_init set to 0.
Vx delegate: error_during_prepare set to 0.
Vx delegate: error_during_invoke set to 0.
EXTERNAL delegate created.
INFO: Applied EXTERNAL delegate.
W [query_hardware_caps:71]Unsupported evis version
W [HandleLayoutInfer:266]Op 18: default layout inference pass.
INFO: invoked
INFO: average time: 102.432 ms
INFO: 0.784314: 653 military uniform
INFO: 0.105882: 907 Windsor tie
INFO: 0.0156863: 458 bow tie
INFO: 0.00784314: 466 bulletproof vest
INFO: 0.00392157: 835 suit
In the other threads, I have found no explanation concerning the message:
W [query_hardware_caps:71]Unsupported evis version
Has anybody found a solution to this problem? Or can anybody suggest a procedure to debug the issue?
Additional precisions:
- Graphical GPU demos available from the desktop environment work correctly.
- I have also tried to compile the example label_image manually and got the same results.