Skip to content

Commit

Permalink
Add handling for unsupported TF feature (compression_lr_multiplier) (o…
Browse files Browse the repository at this point in the history
  • Loading branch information
a-ignatyev authored Aug 13, 2021
1 parent 6b37fca commit 7375636
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nncf/tensorflow/api/compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from typing import Dict
from typing import TypeVar

from nncf import NNCFConfig
from nncf.common.compression import BaseCompressionAlgorithmBuilder
from nncf.tensorflow.graph.model_transformer import TFModelTransformer

Expand All @@ -27,6 +28,14 @@ class TFCompressionAlgorithmBuilder(BaseCompressionAlgorithmBuilder):
order to enable algorithm-specific compression during fine-tuning.
"""

def __init__(self, config: NNCFConfig, should_init: bool = True):
super().__init__(config, should_init)
compression_lr_multiplier = \
config.get_redefinable_global_param_value_for_algo('compression_lr_multiplier', self.name)
if compression_lr_multiplier is not None:
raise Exception('compression_lr_multiplier is not supported when your work with a TF model in NNCF. '
'Please remove the compression_lr_multiplier attribute from your NNCFConfig.')

def _get_state_without_name(self) -> Dict[str, Any]:
"""
Implementation of get_state that returns state without builder name.
Expand Down

0 comments on commit 7375636

Please sign in to comment.