We are trying to transfer the old training code to a more appropriate tf.estimator.Estimator code. In the source code, we customize the original model for the target dataset. Before the training passes, only some layers are loaded using the MonitoredTrainingSession using the checkpoint using variables_to_restore and init_fn . How can I achieve this weight load using the tf.estimator.Estimator method?
you have two options: first easier:
1- use tf.train.init_from_checkpoint in model_fn
tf.train.init_from_checkpoint
model_fn
2- model_fn returns EstimatorSpec . You can set the scaffold through EstimatorSpec .
EstimatorSpec