gpt4 book ai didi

python - 在 tensorflow 2.0 中获取变量范围

转载 作者:行者123 更新时间:2023-12-04 17:37:03 26 4
gpt4 key购买 nike

我正在使用新版本的tensorflow(2.0.0 alpha),我不知道为什么它不允许我运行:

tf.get_variable_scope().reuse_variables()

我收到以下错误:

AttributeError: module 'tensorflow' has no attribute 'get_variable_scope'

我想有一个不同名称的新属性?谢谢!

最佳答案

来自评论

No, variable_scope and get_variable have been removed from TensorFlow 2.x (although you can still find them under tf.compat.v1). In TF 2.x to returns the current variable scope you can use tf.compat.v1.get_variable_scope instead of get_variable_scope. For more details please refer Migrate from TF1 to TF2. (paraphrased from jdehesa).

关于python - 在 tensorflow 2.0 中获取变量范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56296468/

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