You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Using the MovingAverageQuantizer with parameter per_axis set to True results in this error:
tensorflow_model_optimization\python\core\quantization\keras\quant_ops.py", line 335, in _FakeQuantWithMinMaxVars *
assert len(min_var.get_shape()) == 1
It's caused by this helper function _add_range_weights called by the build function of the MovingAverageQuantizer where the per_axis and tensor_shape parameters are not passed on resulting in only initializing a scalar for the min/max variables. Which later fails the assert.
System information
TensorFlow version: 2.12.0 (binary)
TensorFlow Model Optimization version: 0.7.4 (binary)
Python version: 3.9.16
Describe the expected behavior
There should be a list of values in the min/max variables.
Describe the current behavior
Throws and error because of failed assert in _FakeQuantWithMinMaxVars
Describe the bug
Using the
MovingAverageQuantizer
with parameterper_axis
set to True results in this error:It's caused by this helper function
_add_range_weights
called by the build function of theMovingAverageQuantizer
where theper_axis
andtensor_shape
parameters are not passed on resulting in only initializing a scalar for the min/max variables. Which later fails the assert.System information
TensorFlow version: 2.12.0 (binary)
TensorFlow Model Optimization version: 0.7.4 (binary)
Python version: 3.9.16
Describe the expected behavior
There should be a list of values in the min/max variables.
Describe the current behavior
Throws and error because of failed assert in
_FakeQuantWithMinMaxVars
Code to reproduce the issue
Additional context
Changing the
build
function ofMovingAverageQuantizer
to pass the mentioned parameters like:fixes the issue and results in the expected behavior.
The text was updated successfully, but these errors were encountered: