【问题标题】:R: AttributeError: module 'tensorflow' has no attribute 'reset_default_graph' get broken down with RR:AttributeError:模块'tensorflow'没有属性'reset_default_graph'被R分解
【发布时间】:2019-12-15 23:56:19
【问题描述】:

我在 R 中的 keras tensorflow 会话中获得了可变结果。我希望在训练我的模型时更加一致。我试过使用 use_session_with_seed() 但它得到了错误

2019-12-15 17:46:31.057595: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll
Error in py_get_attr_impl(x, name, silent) : 
  AttributeError: module 'tensorflow' has no attribute 'reset_default_graph'

有没有可以安装的包...

reticulate::py_install() 

我不确定这是否有帮助,但是当我导入 tensorflow 并尝试 tf$reset_Default_Graph 时出现错误

library(tensorflow)
tf$reset_default_graph()
Error in py_get_attr_impl(x, name, silent) : 
  AttributeError: module 'tensorflow' has no attribute 'reset_default_graph'

我在跑... 蟒蛇3.7 r 3.6.1 张量流 2.0 蟒蛇 窗户 10 gpu = nvidia 1060 with max q design

【问题讨论】:

    标签: r tensorflow keras


    【解决方案1】:

    TensorFlow 2.0 默认使用 Eager Execution,不包含tf$reset_default_graph() 方法。你仍然可以在 compat 模块中找到它,tf$compat$v1$reset_default_graph

    【讨论】:

    猜你喜欢
    • 2017-04-08
    • 1970-01-01
    • 2020-10-17
    • 1970-01-01
    • 1970-01-01
    • 2020-06-05
    • 2020-02-04
    • 2019-09-18
    • 2019-09-16
    相关资源
    最近更新 更多