gpt4 book ai didi

python - 属性错误 : module 'tensorflow' has no attribute 'reset_default_graph'

转载 作者:太空狗 更新时间:2023-10-29 21:21:50 25 4
gpt4 key购买 nike

我已经安装了 tensorflow 版本 r0.11。

在我的文件名 cartpole.py 中,我导入了 tensorflow:

 import tensorflow as tf  

并使用它:

 tf.reset_default_graph()

尝试在 PyCharm 中运行我的项目时出现此错误:

in <module>
tf.reset_default_graph()
AttributeError: module 'tensorflow' has no attribute 'reset_default_graph'

我该如何修复这个错误?

最佳答案

此功能已弃用。请改用 tf.compat.v1.reset_default_graph()

更新这不是唯一过时的功能。查看this answer用于发行说明和转换脚本。

关于python - 属性错误 : module 'tensorflow' has no attribute 'reset_default_graph' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40782271/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com