File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
tensorflow_model_optimization/python/core/clustering/keras Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -196,8 +196,7 @@ def _strip_clustering_wrapper(layer):
196196 layer .layer ._non_trainable_weights = []
197197 for i in range (len (layer .restore )):
198198 # This is why we used integers as keys
199- name , weight = layer .restore [i ]
200- weight_name = layer .layer .name + "/" + name
199+ name , weight_name , weight = layer .restore [i ]
201200 # In both cases we use k.batch_get_value since we need physical copies
202201 # of the arrays to initialize a new tensor
203202 if i in layer .gone_variables :
Original file line number Diff line number Diff line change @@ -244,12 +244,13 @@ def fn():
244244
245245 for ct , weight in enumerate (self .layer .weights ):
246246 name = self ._weight_name (weight .name )
247+ full_name = self .layer .name + "/" + name
247248 if ct in self .gone_variables :
248249 # Again, not sure if this is needed
249250 weight_name = clusterable_weights_to_variables [name ]
250- self .restore .append ((name , get_updater (weight_name )))
251+ self .restore .append ((name , full_name , get_updater (weight_name )))
251252 else :
252- self .restore .append ((name , weight ))
253+ self .restore .append ((name , full_name , weight ))
253254
254255 def call (self , inputs ):
255256 # Go through all tensors and replace them with their clustered copies.
You can’t perform that action at this time.
0 commit comments