无法从tensorflow.python.keras.layers导入BatchNormalization

问题描述 投票:0回答:1

我正在尝试运行一个项目。我的 TensorFlow 版本是 2.9.2。我需要导入 BatchNormalization,但无法导入它。这是错误消息: AttributeError: module 'tensorflow.python.keras.layers' has no attribute 'BatchNormalization' enter image description here enter image description here

我需要从 TensorFlow 导入 BatchNormalization。

tensorflow python-3.7
1个回答
0
投票

这对我有用->

from tensorflow.keras.layers import BatchNormalization

只需从代码中删除 .python

© www.soinside.com 2019 - 2024. All rights reserved.