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

Commit

Permalink
Fix crash: "No module named 'tf_keras'".
Browse files Browse the repository at this point in the history
Directly importing tensorflow.python.layers.normalization seems to no longer work.

PiperOrigin-RevId: 566806677
  • Loading branch information
reedwm committed Sep 20, 2023
1 parent d344546 commit 5996abc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/tf_cnn_benchmarks/convnet_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import mlperf
from tensorflow.python.layers import convolutional as conv_layers
from tensorflow.python.layers import core as core_layers
from tensorflow.python.layers import normalization as normalization_layers
from tensorflow.python.layers import pooling as pooling_layers
from tensorflow.python.training import moving_averages

Expand Down Expand Up @@ -462,7 +461,7 @@ def batch_norm(self, input_layer=None, decay=0.999, scale=False,
center = True
with tf.variable_scope(name) as scope:
if self.use_tf_layers:
layer_obj = normalization_layers.BatchNormalization(
layer_obj = tf.layers.BatchNormalization(
momentum=decay,
scale=scale,
epsilon=epsilon,
Expand Down

0 comments on commit 5996abc

Please sign in to comment.