From b308a9cd2bb6bb7e3e39fe59ee47c52d8a1b5aa7 Mon Sep 17 00:00:00 2001 From: Deepmind Team Date: Fri, 1 Nov 2019 15:14:21 +0000 Subject: [PATCH] Internal changes to tf.contrib symbols PiperOrigin-RevId: 277929284 --- transporter/transporter.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/transporter/transporter.py b/transporter/transporter.py index 22564e32..406e48f2 100644 --- a/transporter/transporter.py +++ b/transporter/transporter.py @@ -22,8 +22,10 @@ import sonnet as snt import tensorflow as tf +from tensorflow.contrib import framework as contrib_framework +from tensorflow.contrib import layers as contrib_layers -nest = tf.contrib.framework.nest +nest = contrib_framework.nest # Paper submission used BatchNorm, but we have since found that Layer & Instance # norm can be quite a lot more stable. @@ -189,7 +191,7 @@ def _build(self, image, is_training): A tensor of features of shape [B, F_h, F_w, N] where F_h and F_w are the height and width of the feature map and N = 4 * `self._filters` """ - regularizers = {"w": tf.contrib.layers.l2_regularizer(1.0)} + regularizers = {"w": contrib_layers.l2_regularizer(1.0)} features = image for l in range(len(self._filters)): @@ -257,7 +259,7 @@ def _build(self, image, is_training): conv = snt.Conv2D( self._num_keypoints, [1, 1], stride=1, - regularizers={"w": tf.contrib.layers.l2_regularizer(1.0)}, + regularizers={"w": contrib_layers.l2_regularizer(1.0)}, name="conv_1/conv_1") image_features = self._keypoint_encoder(image, is_training=is_training) @@ -400,7 +402,7 @@ def _build(self, features, is_training): height, width = features.shape.as_list()[1:3] filters = self._initial_filters - regularizers = {"w": tf.contrib.layers.l2_regularizer(1.0)} + regularizers = {"w": contrib_layers.l2_regularizer(1.0)} layer = 0 @@ -458,4 +460,3 @@ def _build(self, features, is_training): assert width == self._output_width return features -