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

Hi,
Not sure if this is the right place for this question (TensorFlow might be better?) but here it goes:
I have a tensorflowlite model. I used flatbuffer_translate in tensorflow/compiler/mlir/lite directory to get an mlir output 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

As far as I can tell this should only be triggered by the presence of a tf_saved_model.semantics attribute, which happens in the TFLite importer when the model has a signature_defs. However somehow it still import a “main” without making it private, which is a bug.
A workaround would be to remove the attribute manually, but if you can file a bug with a reproducer it may be useful.

Thanks a lot for that answer, it was exactly right.
The problem with the bug is that I can’t share my tflite model but I used the flatbuffer_translate tool I built out of Tensorflow hierarchy and just ran it on my model with the following options:
–tflite-flatbuffer-to-mlir
–mlir-print-local-scope
–emit-builtin-tflite-ops
–lower-tensor-list-ops
Thanks again.