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
441441 # modifications don't affect the original model, or its weights.
442442 try :
443443 model_copy = _clone_model_with_weights (model )
444- except ValueError :
444+ except ValueError as er :
445445 raise ValueError (
446446 'Unable to clone model. This generally happens if you used custom '
447447 'Keras layers or objects in your model. Please specify them via '
448448 '`quantize_scope` for your calls to `quantize_model` and '
449- '`quantize_apply`.' )
449+ '`quantize_apply`. [%s].' % er )
450450
451451 # 2. Remove QuantizeAnnotate wrappers from the layers in the model. This
452452 # 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):
362362 '`quantize_scope` for your calls to `quantize_model` and '
363363 '`quantize_apply`.' )
364364
365- self .assertEqual ( str (err .exception ), expected_error )
365+ self .assertIn ( expected_error , str (err .exception ))
366366
367367 def testQuantize_RaisesErrorIfNoQuantizeConfig (self ):
368368 annotated_model = keras .Sequential ([
You can’t perform that action at this time.
0 commit comments