eIQ ML: i.MX93: object detection model fails to be converted with vela

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

eIQ ML: i.MX93: object detection model fails to be converted with vela

Jump to solution
1,082 Views
ihermida
Contributor II

Hi guys,

This is the link to the ML guide,  https://www.nxp.com/docs/en/user-guide/IMX-MACHINE-LEARNING-UG.pdf.

Chapter "8.1.2 SSD object detection demo" uses the model ssd_mobilenet_v1_quant.tflite. The problem I found with that model is that cannot be converted with vela, thereby I cannot use the i.MX93 NPU.

Compiling manually the model "ssd_mobilenet_v1_quant.tflite", it cannot be converted, returning the next error

Error: Invalid TFLite file. Got "unpack_from requires a buffer of at least 1836597056 bytes for unpacking 4 bytes at offset 1836597052 (actual buffer size is 298)" while parsing buffers length.

 

 

 

 So, here there are two points.

  1. The script "download_models.py" should check the value when converting a model to notify about its failure, something like

 

-            os.system('vela ' + model + " --output-dir " + vela_dir)
+            ret = os.system('vela ' + model + " --output-dir " + vela_dir)
+            if ret != 0:
+                print(f"Error: Failed to convert model {name} with vela")
+                import sys
+                sys.exit(1)

 

  •  Model "ssd_mobilenet_v1_quant.tflite" is not compatible with vela/npu.
    Is it a problem of that specific model?
    What can I do to use the NPU (Ethos-U65)?

BR / Isaac

0 Kudos
Reply
1 Solution
1,038 Views
pengyong_zhang
NXP Employee
NXP Employee

Hi @ihermida 

a) do you plan to fix download_models.py to report error on failure when downloading or converting the model?

>>>Actually, we have found this error before, And will fix it on the next version BSP code

b) do you know of any well known mirror where to obtain the ssd_mobilenet_v1_quant.tflite model?

>>>You can use the attachment ssd_mobilenet_v1.tflite file.

View solution in original post

3 Replies
1,039 Views
pengyong_zhang
NXP Employee
NXP Employee

Hi @ihermida 

a) do you plan to fix download_models.py to report error on failure when downloading or converting the model?

>>>Actually, we have found this error before, And will fix it on the next version BSP code

b) do you know of any well known mirror where to obtain the ssd_mobilenet_v1_quant.tflite model?

>>>You can use the attachment ssd_mobilenet_v1.tflite file.

1,044 Views
ihermida
Contributor II

Hi @pengyong_zhang ,

 

The problem is that link is broken, I get an access denied from the link https://storage.googleapis.com/tfhub-lite-models/tensorflow/lite-model/ssd_mobilenet_v1/1/metadata/2...

The error is

<Error>
<Code>AccessDenied</Code>
<Message>Access denied.</Message>
<Details>Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object. Permission 'storage.objects.get' denied on resource (or it may not exist).</Details>
</Error>
 

So, as commented initially, there are two problems:

  1. The download_models.py does not report an error on failure (or well checking the downloaded file or well checking it was converted with vela)
  2. The link is broken

 

I can download that model from other locations manually, but this failure is currently broking my yocto build (as I do check if the model was correctly downloaded).

 

a) do you plan to fix download_models.py to report error on failure when downloading or converting the model?

b) do you know of any well known mirror where to obtain the ssd_mobilenet_v1_quant.tflite model?

 

BR / Isaac

0 Kudos
Reply
1,054 Views
pengyong_zhang
NXP Employee
NXP Employee

HI @ihermida 

If you can not be converted to vela model, you can delete it and re-download by yourself, then re-covert again by vela command.

I can convert it to vela model without any error on my  iMX93 EVK board.

B.R

0 Kudos
Reply