TypeError: Builder.EndVector() takes 1 positional argument but 2 were given

Hello guys, I was practicing TensorFlow conversion to TensorFlow Lite using the image classification project in the TensorFlow documentation and got an error TypeError: Builder.EndVector() takes 1 positional argument but 2 were given while trying to run the converter

Here is the code:

Convert the model.

converter = tf.lite.TFLiteConverter.from_keras_model(model)
tflite_model = converter.convert()

Save the model.

with open(‘model.tflite’, ‘wb’) as f:
f.write(tflite_model)

what could have possibly happened and how to solve the issue?

@jared_otieno,

Welcome to the Tensorflow Forum!

TypeError: Builder.EndVector() takes 1 positional argument but 2 were given

This may be due to incompatibility between Tensorflow and Flatbuffer versions.

Which Tensorflow version is installed?

Thank you!

Thank you @chunduriv, my installed TensorFlow Version is 2.9.1

Hello @chunduriv should I downgrade the Flatbuffer version or upgrade it?

Yes, you can try to set the version as 1.12.0.

But a simple solution here is to upgrade to the latest tensorflow version which will care for this conflict.Thank you!