From 15e7466efc46970b606faf96286dfc5574e65641 Mon Sep 17 00:00:00 2001 From: liord Date: Tue, 3 Dec 2024 12:50:52 +0200 Subject: [PATCH] Fix notebooks after tpc refactor --- .../keras/example_keras_pruning_mnist.ipynb | 5 ++++- .../mct_features_notebooks/keras/example_keras_qat.ipynb | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tutorials/notebooks/mct_features_notebooks/keras/example_keras_pruning_mnist.ipynb b/tutorials/notebooks/mct_features_notebooks/keras/example_keras_pruning_mnist.ipynb index 5d9694947..92298e512 100644 --- a/tutorials/notebooks/mct_features_notebooks/keras/example_keras_pruning_mnist.ipynb +++ b/tutorials/notebooks/mct_features_notebooks/keras/example_keras_pruning_mnist.ipynb @@ -245,7 +245,10 @@ "\n", " # Create the quantization configuration options and model\n", " default_configuration_options = tp.QuantizationConfigOptions([default_config])\n", - " tp_model = tp.TargetPlatformModel(default_configuration_options)\n", + " tp_model = tp.TargetPlatformModel(default_configuration_options,\n", + " tpc_minor_version=1,\n", + " tpc_patch_version=0,\n", + " tpc_platform_type=\"custom_pruning_notebook_tpc\")\n", "\n", " # Return the target platform capabilities\n", " tpc = tp.TargetPlatformCapabilities(tp_model)\n", diff --git a/tutorials/notebooks/mct_features_notebooks/keras/example_keras_qat.ipynb b/tutorials/notebooks/mct_features_notebooks/keras/example_keras_qat.ipynb index f2f01cba5..e49fc91de 100644 --- a/tutorials/notebooks/mct_features_notebooks/keras/example_keras_qat.ipynb +++ b/tutorials/notebooks/mct_features_notebooks/keras/example_keras_qat.ipynb @@ -189,8 +189,8 @@ }, "outputs": [], "source": [ + "from model_compression_toolkit.target_platform_capabilities.schema.mct_current_schema import Signedness, AttributeQuantizationConfig\n", "from model_compression_toolkit import DefaultDict\n", - "from model_compression_toolkit.target_platform_capabilities.target_platform.op_quantization_config import AttributeQuantizationConfig, Signedness\n", "from model_compression_toolkit.constants import FLOAT_BITWIDTH\n", "from model_compression_toolkit.target_platform_capabilities.constants import KERNEL_ATTR, KERAS_KERNEL, BIAS_ATTR, BIAS\n", "\n", @@ -254,7 +254,10 @@ " # Set default QuantizationConfigOptions in new TargetPlatformModel to be used when no other\n", " # QuantizationConfigOptions is set for an OperatorsSet.\n", " default_configuration_options = tp.QuantizationConfigOptions([default_config])\n", - " tp_model = tp.TargetPlatformModel(default_configuration_options)\n", + " tp_model = tp.TargetPlatformModel(default_configuration_options,\n", + " tpc_minor_version=1,\n", + " tpc_patch_version=0,\n", + " tpc_platform_type=\"custom_qat_notebook_tpc\")\n", " with tp_model:\n", " default_qco = tp.get_default_quantization_config_options()\n", " # Group of OperatorsSets that should not be quantized.\n",