model-optimization icon indicating copy to clipboard operation
model-optimization copied to clipboard

[clustering] Possible wrong call of the centroids initializer from the ClusterWeights wrapper

Open aserenko opened this issue 3 years ago • 1 comments

An instance of the centroids initializer expects to be initialized with data_format. However, instead of data_format it gets num_channels here: https://github.com/tensorflow/model-optimization/blob/v0.7.1/tensorflow_model_optimization/python/core/clustering/keras/cluster_wrapper.py#L218 I suppose that line is erroneous. This may cause looping over the the wrong axis during clusterization when data_format is channels_first.

aserenko avatar Mar 01 '22 13:03 aserenko

Hi @aserenko Thank you for the reported bug. The fix is in this PR https://github.com/tensorflow/model-optimization/pull/951

wwwind avatar Mar 23 '22 15:03 wwwind