File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
tensorflow_model_optimization/python/core/quantization/keras Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -441,12 +441,12 @@ def _quantize(layer): # pylint: disable=missing-docstring
441
441
# modifications don't affect the original model, or its weights.
442
442
try :
443
443
model_copy = _clone_model_with_weights (model )
444
- except ValueError :
444
+ except ValueError as er :
445
445
raise ValueError (
446
446
'Unable to clone model. This generally happens if you used custom '
447
447
'Keras layers or objects in your model. Please specify them via '
448
448
'`quantize_scope` for your calls to `quantize_model` and '
449
- '`quantize_apply`.' )
449
+ '`quantize_apply`. [%s].' % er )
450
450
451
451
# 2. Remove QuantizeAnnotate wrappers from the layers in the model. This
452
452
# extracts the original model structure (easier to transform), and
Original file line number Diff line number Diff line change @@ -362,7 +362,7 @@ def testQuantizeCustomLayerWithoutQuantizeScope_RaisesError(self):
362
362
'`quantize_scope` for your calls to `quantize_model` and '
363
363
'`quantize_apply`.' )
364
364
365
- self .assertEqual ( str (err .exception ), expected_error )
365
+ self .assertIn ( expected_error , str (err .exception ))
366
366
367
367
def testQuantize_RaisesErrorIfNoQuantizeConfig (self ):
368
368
annotated_model = keras .Sequential ([
You can’t perform that action at this time.
0 commit comments