Unverified Commit 3a19c394 authored by Toby Boyd's avatar Toby Boyd Committed by GitHub
Browse files

compat.v1.trainable_variables() (#6203)

parent ae699073
...@@ -364,7 +364,7 @@ def resnet_model_fn(features, labels, mode, model_class, ...@@ -364,7 +364,7 @@ def resnet_model_fn(features, labels, mode, model_class,
# loss is computed using fp32 for numerical stability. # loss is computed using fp32 for numerical stability.
[ [
tf.nn.l2_loss(tf.cast(v, tf.float32)) tf.nn.l2_loss(tf.cast(v, tf.float32))
for v in tf.trainable_variables() for v in tf.compat.v1.trainable_variables()
if loss_filter_fn(v.name) if loss_filter_fn(v.name)
]) / tf.distribute.get_strategy().num_replicas_in_sync ]) / tf.distribute.get_strategy().num_replicas_in_sync
tf.compat.v1.summary.scalar('l2_loss', l2_loss) tf.compat.v1.summary.scalar('l2_loss', l2_loss)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment