Skip to content

Commit 634242c

Browse files
committed
Add comment on tf1.7.0 duplicate variable error
1 parent 570a42d commit 634242c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Network.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ def __init__(self, flags, hps):
7474

7575
self.model = models[flags.model]()
7676
self.model.build_graph()
77-
var_to_save = tf.trainable_variables() + [var for var in tf.global_variables()
78-
if ('bn' in var.name) and ('Adam' not in var.name) and ('Momentum' not in var.name) or ('global_step' in var.name)]
77+
var_to_save = tf.trainable_variables() + [var for var in tf.global_variables() if ('bn' in var.name) and ('Adam' not in var.name) and ('Momentum' not in var.name) or ('global_step' in var.name)] # tf 1.7.0 would complain duplicate batch norm variables, so if you are using tf 1.7.0, pls comment out the second part of var_to_save
7978
logger.debug(
8079
f'Building Model Complete...Total parameters: {self.model.total_parameters(var_list=var_to_save)}')
8180

0 commit comments

Comments
 (0)