[英]Error when importing LayerNormalization from keras.layers
I would like to use LayerNormalization, which is documented here: https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/layers/LayerNormalization我想使用 LayerNormalization,这里有记录: https ://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/layers/LayerNormalization
When I import the module当我导入模块时
from tensorflow.python.keras.layers import LayerNormalization
then I get the following Exception:然后我得到以下异常:
Exception has occurred: ImportError
cannot import name 'LayerNormalization' from 'tensorflow.keras.layers'
My keras version is 2.3.1 and my tensorflow version is 1.13.1.我的 keras 版本是 2.3.1,我的 tensorflow 版本是 1.13.1。
Can someone help me?有人能帮我吗?
这是因为您的 TF 版本将其升级到 1.15 或 2.0 可以正常工作,请参阅此colab笔记本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.