tf.Variable trainable的作用

input_data = tf.Variable(data_initalizer, trainable=False, collections=[])

设定trainable=False 可以防止该变量被数据流图的 GraphKeys.TRAINABLE_VARIABLES 收集, 
这样我们就不会在训练的时候尝试更新它的值。

猜你喜欢

转载自blog.csdn.net/oMoDao1/article/details/82146048
今日推荐