Skip to content

Commit

Permalink
setting variable scope
Browse files Browse the repository at this point in the history
  • Loading branch information
rfelixmg committed Oct 16, 2018
1 parent 647722d commit 82822ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def update_step(self, loss, trainables=False):
optimizer_func = self.__get_optimizer__(self.optimizer['name'] if 'name' in self.optimizer else 'adam')
self.__update_lr__()

with tf.variable_scope(self.namespace):
with tf.variable_scope(self.namespace, reuse=tf.AUTO_REUSE):
with tf.control_dependencies(tf.get_collection(tf.GraphKeys.UPDATE_OPS)):
return optimizer_func(learning_rate=self.lr).minimize(loss,
var_list=trainables if trainables else self.trainable_variables(),
Expand Down

0 comments on commit 82822ec

Please sign in to comment.