Altering TFLite from ModelZOO

Hello, I am trying to alter TFLite model from ModelZoo (specifically Resnet_v1_50) to change number of classes and fine-tune just the output layers and keep the rest optimized. I have managed to change the inner structure, so that when i read from modified TFLite format by tflite_schema.Model.GetRootAsModel(), all the Tensors, shape, and Buffers are correct, but the flatbuffer seems to be corrupted. The running code outputs " Start node resnet_v1_50/conv1/Pad wasn’t found

Start node resnet_v1_50/Pad wasn’t found". I suspect that in my conversions I lost the header, but I am not able to identify it with certainty even in the provided TFLite file. Do you have any experience with the correct transfer?

1 Like

Welcome to the Hailo Community!

When you modify a model, it often results in changes to layer names. The Hailo Model Zoo retrieves layer names from YAML configuration files - for example:

GitHub - Hailo Model Zoo - resnet_v1_50.yaml

For your own models, or modified versions of existing models, you should use the generic model conversion flow provided by the Hailo Dataflow Compiler. I recommend working through the built-in tutorials to understand how the process works - for instance how to define the start- and end-nodes.

To access the tutorials, run the following command inside the Hailo AI Software Suite Docker container:

hailo tutorial