From 7e8cc0aa2fd68241e7100756567ae9355a02e580 Mon Sep 17 00:00:00 2001 From: Andrey Churkin Date: Fri, 7 Feb 2025 14:36:23 +0000 Subject: [PATCH] remove strip --- README.md | 3 --- .../quantization_aware_training/Usage.md | 6 +----- .../tensorflow/mobilenet_v2/main.py | 4 ---- .../tensorflow/mobilenet_v2/main.py | 6 +----- 4 files changed, 2 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 32ee76e4106..fe78cdaf631 100644 --- a/README.md +++ b/README.md @@ -201,9 +201,6 @@ def transform_fn(data_item): calibration_dataset = nncf.Dataset(val_dataset, transform_fn) # Step 3: Run the quantization pipeline quantized_model = nncf.quantize(model, calibration_dataset) -# Step 4: Remove auxiliary layers and operations added during the quantization process, -# resulting in a clean, fully quantized model ready for deployment. -stripped_model = nncf.strip(quantized_model) ``` diff --git a/docs/usage/training_time_compression/quantization_aware_training/Usage.md b/docs/usage/training_time_compression/quantization_aware_training/Usage.md index 8ae7163e677..d2cfa5be1cb 100644 --- a/docs/usage/training_time_compression/quantization_aware_training/Usage.md +++ b/docs/usage/training_time_compression/quantization_aware_training/Usage.md @@ -60,11 +60,7 @@ ov_quantized_model = ov.convert_model(quantized_model.cpu(), example_input=dummy # To OpenVINO format import openvino as ov -# Removes auxiliary layers and operations added during the quantization process, -# resulting in a clean, fully quantized model ready for deployment. -stripped_model = nncf.strip(quantized_model) - -ov_quantized_model = ov.convert_model(stripped_model) +ov_quantized_model = ov.convert_model(quantized_model) ``` diff --git a/examples/post_training_quantization/tensorflow/mobilenet_v2/main.py b/examples/post_training_quantization/tensorflow/mobilenet_v2/main.py index 5f22d516e22..98f77d94650 100644 --- a/examples/post_training_quantization/tensorflow/mobilenet_v2/main.py +++ b/examples/post_training_quantization/tensorflow/mobilenet_v2/main.py @@ -144,10 +144,6 @@ def transform_fn(data_item): calibration_dataset = nncf.Dataset(val_dataset, transform_fn) tf_quantized_model = nncf.quantize(tf_model, calibration_dataset) -# Removes auxiliary layers and operations added during the quantization process, -# resulting in a clean, fully quantized model ready for deployment. -tf_quantized_model = nncf.strip(tf_quantized_model) - ############################################################################### # Benchmark performance, calculate compression rate and validate accuracy diff --git a/examples/quantization_aware_training/tensorflow/mobilenet_v2/main.py b/examples/quantization_aware_training/tensorflow/mobilenet_v2/main.py index 233ec512727..fecdcd83574 100644 --- a/examples/quantization_aware_training/tensorflow/mobilenet_v2/main.py +++ b/examples/quantization_aware_training/tensorflow/mobilenet_v2/main.py @@ -160,15 +160,11 @@ def transform_fn(data_item): # However, training for more than 1 epoch would further improve the quantized model's accuracy. tf_quantized_model.fit(train_dataset, epochs=1, verbose=1) -# Removes auxiliary layers and operations added during the quantization process, -# resulting in a clean, fully quantized model ready for deployment. -stripped_model = nncf.strip(tf_quantized_model) - ############################################################################### # Benchmark performance, calculate compression rate and validate accuracy ov_model = ov.convert_model(tf_model) -ov_quantized_model = ov.convert_model(stripped_model) +ov_quantized_model = ov.convert_model(tf_quantized_model) fp32_ir_path = ROOT / "mobilenet_v2_fp32.xml" ov.save_model(ov_model, fp32_ir_path, compress_to_fp16=False)