From 424cf3ab0418794aa8ade77d143a6951deef9055 Mon Sep 17 00:00:00 2001 From: zehao-intel Date: Wed, 27 Sep 2023 19:22:37 +0800 Subject: [PATCH] Adapt Example for TF2.14 AutoTrackable API Change (#1290) Signed-off-by: zehao-intel (cherry picked from commit 9079ff1f141423d4581ba083458c7e2e02325f03) --- .../faster_rcnn_inception_resnet_v2/quantization/ptq/main.py | 2 +- .../faster_rcnn_resnet101/quantization/ptq/main.py | 2 +- neural_compressor/adaptor/tf_utils/graph_converter.py | 2 +- .../adaptor/tf_utils/graph_converter_without_calib.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/tensorflow/object_detection/tensorflow_models/faster_rcnn_inception_resnet_v2/quantization/ptq/main.py b/examples/tensorflow/object_detection/tensorflow_models/faster_rcnn_inception_resnet_v2/quantization/ptq/main.py index 3126da87063..a6b44bd7ba4 100644 --- a/examples/tensorflow/object_detection/tensorflow_models/faster_rcnn_inception_resnet_v2/quantization/ptq/main.py +++ b/examples/tensorflow/object_detection/tensorflow_models/faster_rcnn_inception_resnet_v2/quantization/ptq/main.py @@ -53,7 +53,7 @@ def evaluate(model): accuracy (float): evaluation result, the larger is better. """ from neural_compressor.model import Model - from tensorflow.python.training.tracking.tracking import AutoTrackable + from tensorflow.python.trackable.autotrackable import AutoTrackable warmup = 5 iteration = -1 if args.benchmark and args.mode == 'performance': diff --git a/examples/tensorflow/object_detection/tensorflow_models/faster_rcnn_resnet101/quantization/ptq/main.py b/examples/tensorflow/object_detection/tensorflow_models/faster_rcnn_resnet101/quantization/ptq/main.py index 593ae89b41e..10cb95693ee 100644 --- a/examples/tensorflow/object_detection/tensorflow_models/faster_rcnn_resnet101/quantization/ptq/main.py +++ b/examples/tensorflow/object_detection/tensorflow_models/faster_rcnn_resnet101/quantization/ptq/main.py @@ -53,7 +53,7 @@ def evaluate(model): accuracy (float): evaluation result, the larger is better. """ from neural_compressor.model import Model - from tensorflow.python.training.tracking.tracking import AutoTrackable + from tensorflow.python.trackable.autotrackable import AutoTrackable warmup = 5 iteration = -1 if args.benchmark and args.mode == 'performance': diff --git a/neural_compressor/adaptor/tf_utils/graph_converter.py b/neural_compressor/adaptor/tf_utils/graph_converter.py index 27b24bf4c0e..c237293818d 100644 --- a/neural_compressor/adaptor/tf_utils/graph_converter.py +++ b/neural_compressor/adaptor/tf_utils/graph_converter.py @@ -83,7 +83,7 @@ version1_lte_version2, ) -TF_SUPPORTED_MAX_VERSION = "2.13.0" +TF_SUPPORTED_MAX_VERSION = "2.14.0" TF_SUPPORTED_MIN_VERSION = "1.14.0" logger = logging.getLogger("neural_compressor") diff --git a/neural_compressor/adaptor/tf_utils/graph_converter_without_calib.py b/neural_compressor/adaptor/tf_utils/graph_converter_without_calib.py index cfa18885dca..1aaf15feaa8 100644 --- a/neural_compressor/adaptor/tf_utils/graph_converter_without_calib.py +++ b/neural_compressor/adaptor/tf_utils/graph_converter_without_calib.py @@ -56,7 +56,7 @@ version1_lte_version2, ) -TF_SUPPORTED_MAX_VERSION = "2.13.0" +TF_SUPPORTED_MAX_VERSION = "2.14.0" TF_SUPPORTED_MIN_VERSION = "1.14.0" logger = logging.getLogger("neural_compressor")