Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit 5996abc

Browse files
committed
Fix crash: "No module named 'tf_keras'".
Directly importing tensorflow.python.layers.normalization seems to no longer work. PiperOrigin-RevId: 566806677
1 parent d344546 commit 5996abc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

scripts/tf_cnn_benchmarks/convnet_builder.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import mlperf
2626
from tensorflow.python.layers import convolutional as conv_layers
2727
from tensorflow.python.layers import core as core_layers
28-
from tensorflow.python.layers import normalization as normalization_layers
2928
from tensorflow.python.layers import pooling as pooling_layers
3029
from tensorflow.python.training import moving_averages
3130

@@ -462,7 +461,7 @@ def batch_norm(self, input_layer=None, decay=0.999, scale=False,
462461
center = True
463462
with tf.variable_scope(name) as scope:
464463
if self.use_tf_layers:
465-
layer_obj = normalization_layers.BatchNormalization(
464+
layer_obj = tf.layers.BatchNormalization(
466465
momentum=decay,
467466
scale=scale,
468467
epsilon=epsilon,

0 commit comments

Comments
 (0)