Tflite model maker salad colab

I am using the model maker salad colab and get this error everytime I run the evaluate function on the newly created tflite model.
InvalidArgumentError: required broadcastable shapes [Op:Mul]

Any ideas on what I might be doing wrong? This error gets worse if I ignore it and continue to the other steps.

hi @Winton_Cape seems like this your first time in the community.It seems like you issue is same as in this thread InvalidArgumentError: required broadcastable shapes [Op:Mul]

You could try running and make sure to use just cpu if you are on google colab because there are issues with GPU currently as mentioned in that thread. And I don’t know if that’s been fixed.

!pip install tensorflow==2.5.0

if you really want to use gpu and are comfortable switching between nightly version (I would recommend this considering you are doing a tutorial part with not trivial dataset), you can just use this

!pip install tflite-model-maker-nightly
1 Like

Hi Thanks for the response. In both seneraos I reset notebook to factory settings first.
OPTION 1

  1. Set notebook settings in colab to NONE
  2. Ran all code to the evaluate cell and then got error 'Incompatible shapes: [1,25] v.x [4] [op:Mul]

OPTION 2

  1. Installed tensorflow==2.5.0 and then installed modelmaker nightly
  2. When I tried to install required packages (the second notebook cell), it gave an error on the line from tflite_model_maker.config import ExportFormat
    AttributeError: module ‘tensorflow.python.training.experimental.mixed_precision’ has no attribute ‘_register_wrapper_optimizer_cls’

As in the original issue, I remember that I got this working a couple of weeks ago, I am just trying to get back to that point.

I am pretty sure model maker nightly doesn’t work with tf 2.5.0. have you tried just model maker nightly?

1 Like

WOW! it works… thank you so much. You were right. I just used the native version of tensorflow provided by the notebook and installed the tflite-model-maker-nightly