运行WaterGAN时出现:
AttributeError: module 'tensorflow._api.v1.compat.v1' has no attribute 'placeholder'
(这里我替换时出现错误,把placeholder->placeholderr,所以一定一定要细心细心细心)
将
import tensorflow as tf
改为
import tensorflow.compat.v1 as tf
解决WaterGAN运行中AttributeError
本文解决在运行WaterGAN时遇到的AttributeError问题,详细介绍了如何修正代码中tensorflow库的导入方式,从使用'tensorflow'更改为'tensorflow.compat.v1',确保代码兼容性。
运行WaterGAN时出现:
AttributeError: module 'tensorflow._api.v1.compat.v1' has no attribute 'placeholder'
(这里我替换时出现错误,把placeholder->placeholderr,所以一定一定要细心细心细心)
将
import tensorflow as tf
改为
import tensorflow.compat.v1 as tf
您可能感兴趣的与本文相关的镜像
TensorFlow-v2.15
TensorFlow 是由Google Brain 团队开发的开源机器学习框架,广泛应用于深度学习研究和生产环境。 它提供了一个灵活的平台,用于构建和训练各种机器学习模型
1254
5177
1万+

被折叠的 条评论
为什么被折叠?