|
22 | 22 | def weight_variable(shape, stddev=0.01):
|
23 | 23 | """Returns the weight variable."""
|
24 | 24 | logging.vlog(1, 'weight init for shape %s', str(shape))
|
25 |
| - return tf.compat.v1.get_variable( |
| 25 | + return tf.get_variable( |
26 | 26 | 'w', shape, initializer=tf.random_normal_initializer(stddev=stddev))
|
27 | 27 |
|
28 | 28 |
|
29 | 29 | def bias_variable(shape):
|
30 |
| - return tf.compat.v1.get_variable( |
| 30 | + return tf.get_variable( |
31 | 31 | 'b', shape, initializer=tf.zeros_initializer())
|
32 | 32 |
|
33 | 33 |
|
@@ -61,12 +61,12 @@ def make_conv_sep2d_layer(input_node,
|
61 | 61 | filter_size_2 = filter_size
|
62 | 62 | logging.vlog(1, 'layer %s in %d out %d chan mult %d', layer_name, in_channels,
|
63 | 63 | out_channels, channel_multiplier)
|
64 |
| - with tf.compat.v1.variable_scope(layer_name): |
65 |
| - with tf.compat.v1.variable_scope('depthwise'): |
| 64 | + with tf.variable_scope(layer_name): |
| 65 | + with tf.variable_scope('depthwise'): |
66 | 66 | w_depthwise = weight_variable(
|
67 | 67 | [filter_size, filter_size_2, in_channels, channel_multiplier],
|
68 | 68 | stddev=stddev)
|
69 |
| - with tf.compat.v1.variable_scope('pointwise'): |
| 69 | + with tf.variable_scope('pointwise'): |
70 | 70 | w_pointwise = weight_variable(
|
71 | 71 | [1, 1, in_channels * channel_multiplier, out_channels], stddev=stddev)
|
72 | 72 | h_conv = tf.nn.separable_conv2d(
|
@@ -119,7 +119,7 @@ def make_conv_layer(input_node,
|
119 | 119 | filter_size_2 = filter_size
|
120 | 120 | logging.vlog(
|
121 | 121 | 1, 'layer %s in %d out %d', layer_name, in_channels, out_channels)
|
122 |
| - with tf.compat.v1.variable_scope(layer_name): |
| 122 | + with tf.variable_scope(layer_name): |
123 | 123 | w_conv = weight_variable(
|
124 | 124 | [filter_size, filter_size_2, in_channels, out_channels], stddev=stddev)
|
125 | 125 | h_conv = conv2d(
|
|
0 commit comments