Home > front end >  cannot import name 'normalization' from 'tensorflow.python.keras.layers'
cannot import name 'normalization' from 'tensorflow.python.keras.layers'

Time:04-09

I am trying to use tensorflow_rankings, but cannot import it due to the above error. I am using tensorflow 2.8.0 and tensorflow_rankings 0.5.0, which seem to be the latest stable builds. They are what get automatically installed from

pip install tensorflow
pip install tensorflow_ranking

I am on Python 3.8.10, Windows 11.

The TF 2.8.0 docs show there is a Normalization layer in tf.keras.layers. The error seems to come from:

from tensorflow.python.keras.layers import normalization as keras_norm

in

from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder

Any advice?

CodePudding user response:

Seems my installation of TF was corrupted. A full uninstall and reinstall fixed it.

  • Related