Warnings on model conversion from PyTorch (ONNX) to TFLite

I was following this guide to convert my simple model from PyTorch to ONNX to TensorFlow to TensorFlow Lite for deployment. But I received the following warnings on TensorFlow 2.3.0:

2021-08-19 12:01:09.231710: W tensorflow/python/util/util.cc:348] Sets are not currently considered sequences, but this may change in the future, so consider avoiding using them.
2021-08-19 12:01:09.347085: W tensorflow/compiler/mlir/lite/python/tf_tfl_flatbuffer_helpers.cc:313] Ignored output_format.
2021-08-19 12:01:09.347119: W tensorflow/compiler/mlir/lite/python/tf_tfl_flatbuffer_helpers.cc:316] Ignored drop_control_dependency.

On TensorFlow 2.5.0:

2021-08-19 14:50:23.764805: W tensorflow/python/util/util.cc:348] Sets are not currently considered sequences, but this may change in the future, so consider avoiding using them.
WARNING:absl:Found untraced functions such as gen_tensor_dict while saving (showing 1 of 1). These functions will not be directly callable after loading.
2021-08-19 14:50:23.853142: W tensorflow/compiler/mlir/lite/python/tf_tfl_flatbuffer_helpers.cc:345] Ignored output_format.
2021-08-19 14:50:23.853172: W tensorflow/compiler/mlir/lite/python/tf_tfl_flatbuffer_helpers.cc:348] Ignored drop_control_dependency.
2021-08-19 14:50:23.853177: W tensorflow/compiler/mlir/lite/python/tf_tfl_flatbuffer_helpers.cc:354] Ignored change_concat_input_ranges.

Other versions (The onnx-tf was from PyPI instead from their latest GitHub):

numpy == 1.19.5
onnx == 1.10.1
onnx_tf == 1.8.0
tensorflow_gpu == 2.5.0
torch == 1.9.0

Although the model gets converted without any errors and I’ve checked the ONNX graph and it looks correct and I’ve also tried inference with dummy values and that also works but I want to be sure that the model doesn’t break after deployment because of something I missed in these warnings.

You can safely ignore the above warning messages.

1 Like

Is there a way to suppress these warnings from showing up on stdout? I have a CLI tool which runs the conversion for multiple models and displays some other logs on stdout as well and these warnings polluter stdout quite a bit.

EDIT: Found that adding the following to the top suppresses those warnings.

import os

os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"