Mismatch opcode version TRANSPOSE

484 views
Skip to first unread message

Antoine Lebaud

unread,
Oct 4, 2021, 2:35:42 PM10/4/21
to TensorFlow Lite

Hi everyone,

I am trying to use a TensorFlow model converted to TFLite Micro on my Arduino BLE, however I got the following error.

```

Didn't find op for builtin opcode 'TRANSPOSE' version '2'. An older version of this builtin might be supported. Are you using an old TFLite binary with a newer model?

Failed to get registration from op code TRANSPOSE

 Failed starting model allocation.

Invoke() called after initialization failed

Invoke failed!

```

I have checked the arduino tensorflow lite library version, that the latest. 

I have used tensorflow-2.6.0 to train and convert my model.


My conversion code:

```

# Convert the model to the TensorFlow Lite format without quantization
converter = tf.lite.TFLiteConverter.from_keras_model(origin_model)

converter.target_spec.supported_ops = [
tf.lite.OpsSet.TFLITE_BUILTINS, # enable TensorFlow Lite ops.
]

tflite_model = converter.convert()

# Save the model to disk
open(FOLDER_DRIVE_MODEL_DL + 'tflite/' + tflite_model_name + ".tflite", "wb").write(tflite_model)

```

My converted model architecture:

stellar-shadow-117.png

In any case, don’t hesitate to correct me if I am wrong.

Terry Heo (Woncheol)

unread,
Oct 5, 2021, 12:18:54 AM10/5/21
to Antoine Lebaud, TensorFlow Lite
Hi, Antoine

Did you use AllOpsResolver?
If you're using your own MicroMutableOpResolver, you should register op kernels you're using.

Terry

Did you receive this email by mistake ? Sorry about that! Please note that this message and the files attached must stay CONFIDENTIAL. If you are not an intended recipient you may not review, copy or distribute this message. If you have received this message in error, please notify us immediately by replying to this email and then delete it from your system.

--
You received this message because you are subscribed to the Google Groups "TensorFlow Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tflite+un...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tflite/42d929ba-6427-404d-988a-454166c346ben%40tensorflow.org.

Antoine Lebaud

unread,
Oct 5, 2021, 3:08:37 AM10/5/21
to TensorFlow Lite, Terry (Woncheol) Heo, TensorFlow Lite, Antoine Lebaud
Hi Terry,

Thanks for your quick answer.

I used the default imports in my Arduino code :

```
...
#include <TensorFlowLite.h>
#include <tensorflow/lite/micro/all_ops_resolver.h>
#include <tensorflow/lite/micro/micro_error_reporter.h>
#include <tensorflow/lite/micro/micro_interpreter.h>
#include <tensorflow/lite/schema/schema_generated.h>
#include <tensorflow/lite/version.h>
...
```
I have found this issue, which is related to my problem. Would you have any recommendation to generate my own .zip Arduino library?

Antoine

Terry (Woncheol) Heo

unread,
Oct 8, 2021, 12:32:11 AM10/8/21
to TensorFlow Lite, ant...@wisear.io, Terry (Woncheol) Heo, TensorFlow Lite
Please check the example code how to create your own OpResolver.

You should have something like `micro_op_resolver.AddTranspose()`.

Or just simply use AllOpsResolver.

Terry

Advait Jain

unread,
Oct 15, 2021, 2:11:54 PM10/15/21
to Terry (Woncheol) Heo, TensorFlow Lite, ant...@wisear.io
Can you try the latest TFLM Arduino library from this repository and let us know if you continue to run into this issue?

Cross-linking the issue that you had created on the TFLM repository for completeness: https://github.com/tensorflow/tflite-micro/issues/566

And please feel free to ask TFLM-specific questions via a github issue on the TFLM repository or the SIG-micro mailing list.



Advait Jain

unread,
Oct 15, 2021, 2:12:36 PM10/15/21
to Terry (Woncheol) Heo, SIG micro, TensorFlow Lite, ant...@wisear.io
Reply all
Reply to author
Forward
0 new messages