Hi,
I tried to use clustering after pruning the model using the example pruning code by tensorflow.

  
      

      TensorFlow
  

  
    

Pruning in Keras example  |  TensorFlow Model Optimization 2



  

  
    
    
  

  


I getting this error:
/usr/local/lib/python3.7/dist-packages/tensorflow_model_optimization/python/core/clustering/keras/cluster_wrapper.py in build(self, input_shape)
165 # stripping
166 position_original_weight = next(
→ 167 i for i, w in enumerate(self.layer.weights) if w is original_weight)
168 self.position_original_weights[position_original_weight] = weight_name
169
StopIteration
Can someone please help me understand the issue and if it is possible to do clustering after pruning.