Can't load .tflite for "abalone" model

[Google Colab]

I’ve added some code to save “abalone” model as .tflite file and then load it. It creates .tflite file, but then I can’t use it:

ValueError: Cannot set tensor: Dimension mismatch. Got 7 but expected 1 for dimension 1 of input 0.

What’s wrong?

Hi burbilog,

Have you checked input shape with netron.app?

Have you checked input shape

+1

This fixes it:

normalize = preprocessing.Normalization(input_shape=[7])

Keras was keeping a general shape there, [None], and tflite seems to assumes that unknown shapes are 1 (useful for batch size).

1 Like

Thanks, it works now.