rishizek / tensorflow-deeplab-v3

DeepLabv3 built in TensorFlow
MIT License
286 stars 102 forks source link

Question about training with pre-trained model #32

Open eleflea opened 5 years ago

eleflea commented 5 years ago

Hello, I found that you used this code to init the pre-trained model params. But when I training the model with pre-trained model, it will re-init the ResNet params every epoch when calling model_fn. Is this an intentional behavior? Thanks a lot.

    if is_training:
      exclude = [base_architecture + '/logits', 'global_step']
      variables_to_restore = tf.contrib.slim.get_variables_to_restore(exclude=exclude)
      tf.train.init_from_checkpoint(pre_trained_model,
                                    {v.name.split(':')[0]: v for v in variables_to_restore})