Closed zhangjinyangnwpu closed 4 years ago
train_op = tf.train.AdamOptimizer(lr).minimize(loss_xe + w_match * loss_l2u, colocate_gradients_with_ops=True) with tf.control_dependencies([train_op]): train_op = tf.group(*post_ops)
when you define train op like this, if the optimizer will be ignored and only the post_ops will be updated when training, and how is this work?
The tf.control_dependencies ensures that AdamOptimizer is run before the operations contained in post_ops.
https://www.tensorflow.org/versions/r1.14/api_docs/python/tf/control_dependencies
when you define train op like this, if the optimizer will be ignored and only the post_ops will be updated when training, and how is this work?