Skip to content

Question about training with pre-trained model #32

@eleflea

Description

@eleflea

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})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions