Converting tensorflow model and checkpoint to onnx

I am trying to convert a pretrained model (Efficientnet) which I have trained on some custom images and new labels. But when using tf2onnx to convert it to onnx format it requires a checkpoint.meta file? But I can’t see this file anywhere? I only see a .index and .data file from the model when I have trained it.
How can I convert a custom model which is using transfer learning? I have downloaded the model from Tensorflow Model Zoo.

Thanks for any help!

1 Like

You can try to export checkpoint file to .pb with OD api exporters then use tf2onnx. But i dont know if it works with efficientnets. Script is in models\research\object_detection\exporter_main_v2.py

2 Likes

Thank you for your reply.I was able to run

python3 models/research/object_detection/exporter_main_v2.py --output_directory output_model --pipeline_config_path config/pipeline.config --trained_checkpoint_dir trained_checkpoints

which created a new .pb file in the outputs directory.
Do you know if it use any of the checkpoint information in the pipeline.config or will it only use the one in the trained_checkpoints directory? Hence, does it actually just copy the pipeline.config file, but don’t use any information from it?

1 Like

It should use latest checkpoint from trained_checkpoint_dir.
I think pipeline.config is needed to build model

2 Likes

Thanks for your reply. Seems that I got it working by following your tip above.

Thanks again! :slight_smile:

1 Like