From 26e0f46bbf80c05ecb67edb61f47945c3a630a59 Mon Sep 17 00:00:00 2001 From: Tom Wildenhain Date: Thu, 9 Sep 2021 12:47:11 -0700 Subject: [PATCH] Add warning when tensorflow > 2.3 is detected --- keras2onnx/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/keras2onnx/__init__.py b/keras2onnx/__init__.py index a3ffc752..565c97db 100644 --- a/keras2onnx/__init__.py +++ b/keras2onnx/__init__.py @@ -24,10 +24,18 @@ except ImportError: raise AssertionError('Please conda install / pip install tensorflow or tensorflow-gpu before the model conversion.') -from .proto import save_model +from .proto import save_model, is_tensorflow_later_than from .common import Variable, cvtfunc, set_logger_level +from .common.utils import k2o_logger from .funcbook import set_converter, set_converters +if is_tensorflow_later_than("2.3"): + start_red = "\033[91m" + end_color = "\033[00m" + k2o_logger().error( + start_red + "\n**** Tensorflow version > 2.3 is not supported. " + "Please see https://github.com/onnx/keras-onnx/issues/737 ****\n" + end_color) + from .main import convert_keras from .main import export_tf_frozen_graph from .main import build_io_names_tf2onnx