From 58a65fee574c00329cf92b387a6d2513dcbf6100 Mon Sep 17 00:00:00 2001 From: Dmitrii Agibov Date: Mon, 24 Oct 2022 15:08:08 +0100 Subject: MLIA-433 Add TensorFlow Lite compatibility check - Add ability to intercept low level TensorFlow output - Produce advice for the models that could not be converted to the TensorFlow Lite format - Refactor utility functions for TensorFlow Lite conversion - Add TensorFlow Lite compatibility checker Change-Id: I47d120d2619ced7b143bc92c5184515b81c0220d --- src/mlia/devices/ethosu/data_collection.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/mlia/devices/ethosu/data_collection.py') diff --git a/src/mlia/devices/ethosu/data_collection.py b/src/mlia/devices/ethosu/data_collection.py index 6ddebac..c8d5293 100644 --- a/src/mlia/devices/ethosu/data_collection.py +++ b/src/mlia/devices/ethosu/data_collection.py @@ -22,6 +22,7 @@ from mlia.nn.tensorflow.optimizations.select import OptimizationSettings from mlia.nn.tensorflow.utils import save_keras_model from mlia.tools.vela_wrapper import Operators from mlia.tools.vela_wrapper import supported_operators +from mlia.utils.logging import log_action from mlia.utils.types import is_list_of logger = logging.getLogger(__name__) @@ -39,12 +40,10 @@ class EthosUOperatorCompatibility(ContextAwareDataCollector): """Collect operator compatibility information.""" tflite_model = get_tflite_model(self.model, self.context) - logger.info("Checking operator compatibility ...") - ops = supported_operators( - Path(tflite_model.model_path), self.device.compiler_options - ) - logger.info("Done\n") - return ops + with log_action("Checking operator compatibility ..."): + return supported_operators( + Path(tflite_model.model_path), self.device.compiler_options + ) @classmethod def name(cls) -> str: -- cgit v1.2.1