I am fine-tuning my model from a pretrained model using TF-Slim. When I used the create_train_op
, I found that it has a parameter that is variables_to_train
. In some tutorial, it used the flag as follows:
all_trainable = [v for v in tf.trainable_variables()]
trainable = [v for v in all_trainable]
train_op = slim.learning.create_train_op(
opt,
global_step=global_step,
variables_to_train=trainable,
summarize_gradients=True)
But in the official TF-Slim, it does not use
all_trainable = [v for v in tf.trainable_variables()]
trainable = [v for v in all_trainable]
train_op = slim.learning.create_train_op(
opt,
global_step=global_step,
summarize_gradients=True)
So, what is different between with and without using variables_to_train
?