tensorflow - 在v1.0+ 中使用reuse_variables() 有什么危险吗?

标签 tensorflow

在关于升级到 TF 1.0 的文档中 here ,有以下不祥的说法:

结构如 tf.get_variable_scope().reuse_variables()可能不会工作。我们建议删除这些行并用如下行替换它们:

with tf.variable_scope(tf.get_variable_scope(), reuse=True):

我更愿意坚持使用 .reuse_variables()由于我的代码目前的设置方式使得使用建议的习语变得相当困难。到目前为止,我的代码在 v1.0 上似乎运行良好,所以我不确定是否需要担心。文档没有说明是否有弃用计划,或者使用 .reuse_variables() 究竟有什么问题.

最佳答案

tf.variable_scope 已弃用,因此最终它将停止工作。该警告主要是指 TensorFlow 1.0 升级脚本的功能。

关于tensorflow - 在v1.0+ 中使用reuse_variables() 有什么危险吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43217669/

相关文章:

python - 在 GPU 上结合使用 Flair 和 TensorFlow 会产生错误

python - keras 理解词嵌入层

machine-learning - Google Cloud ML Engine 中未找到训练器模块

ubuntu - 在多个 GPU 上使用 TensorFlow 进行训练时计算机崩溃

python - 包含 keras 模型的深度复制类

android - 错误运行 Tensorflow 示例 Android

machine-learning - 如何解决Keras LSTM网络中的loss = Nan问题?

python - TensorFlow 读取并解码 BATCH 图像

python - 单维 tensorflow 占位符

python - 具有动态 ksize 的 Tensorflow maxpool