Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about training with pre-trained model #32

Open
eleflea opened this issue Apr 3, 2019 · 0 comments
Open

Question about training with pre-trained model #32

eleflea opened this issue Apr 3, 2019 · 0 comments

Comments

@eleflea
Copy link

eleflea commented Apr 3, 2019

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})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant