Model.export: EndVector() takes 1 positional argument but 2 were given

It fails at the end during export from what I can tell. This notebook trained succesfully a few days ago on Colab.

Model trains:


model = object_detector.create(train_data, model_spec=spec, epochs=EPOCHS, batch_size=64, train_whole_model=WHOLE_NET, validation_data=validation_data)

This completes and evaluates to ‘APm’: 0.8628725, but the export fails:

# Export to TFlite format
model_file_name = model_name + ".tflite"
label_file_name = model_name + ".labels"
model.export(export_dir='.', tflite_filename=model_file_name, label_filename=label_file_name)
/usr/local/lib/python3.7/dist-packages/tensorflow_lite_support/metadata/ in Pack(self, builder)
    482                 for i in reversed(range(len(self.mean))):
    483                     builder.PrependFloat32(self.mean[i])
--> 484                 mean = builder.EndVector(len(self.mean))
    485         if self.std is not None:
    486             if np is not None and type(self.std) is np.ndarray:

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

Using Colab Pro and there are some issued when I install model_maker…

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
tflite-model-maker 0.3.4 requires urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1, but you have urllib3 1.26.6 which is incompatible.
google-colab 1.0.0 requires requests~=2.23.0, but you have requests 2.27.1 which is incompatible.
datascience 0.10.6 requires folium==0.2.1, but you have folium 0.8.3 which is incompatible.

Ok… So I switched to nightly and that worked

But I’m not getting a “labels.txt” (or any other .txt) file exported.

Following instructions here:

# Export to Tensorflow Lite model and label file in `export_dir`.