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

should not only restore trainable variables in get_embd.py? #25

Open
HongtaoYang opened this issue Sep 13, 2019 · 1 comment
Open

should not only restore trainable variables in get_embd.py? #25

HongtaoYang opened this issue Sep 13, 2019 · 1 comment

Comments

@HongtaoYang
Copy link

HongtaoYang commented Sep 13, 2019

I noticed that you only restore trainable variables in get_embd.py, I guess that is an typo and is not intended?

        with tf.Session(config=tf_config) as sess:
            tf.global_variables_initializer().run()
            print('loading...')
            saver = tf.train.Saver(var_list=tf.trainable_variables())
            saver.restore(sess, args.model_path)
            print('done!')

Restoring only trainable variables will results in very bad performance because some BN weights and maybe some pretrained (frozen) weights are not restored.

@kscp123
Copy link

kscp123 commented Oct 9, 2019

Yes, it will get wrong embedding. I use this way can get right result.
saver = tf.train.Saver()
saver.restore(sess, args.model_path)

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

2 participants