second_train_vars = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES,
    'scope/prefix/for/second/vars')
second_train_op = optimizer.minimize(cost, var_list=second_train_vars)
"freeze" some variables/scopes in tensorflow: stop_gradient vs passing variables to minimize