Tf-opt is saying “error: non-exported function @main should be private” for a file generated by flatbuffer_translate

Hi,
I’m using a tool called soda-opt to generate C models out of tensorflowlite models.I used flatbuffer_translate in tensorflow/compiler/mlir/lite directory to get an mlir output from my tensorflowlite and I’m running this through tf-opt in tensorflow/compiler/mlir directory which is giving me this error about non-exported function @main.
Any idea why this is happening and how to get around it?

Thanks

Hello @mkal
The error is due to the flatbuffer_translate tool not include the @main function by default, as it’s specific to TensorFlow Lite. Please add --add-entry-point or --add-main flag to your command to create @main function in respective directory.
Thank you.