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

Load pretrained weights when multiple models exist #4

Closed
taehoonlee opened this issue Feb 7, 2018 · 0 comments
Closed

Load pretrained weights when multiple models exist #4

taehoonlee opened this issue Feb 7, 2018 · 0 comments

Comments

@taehoonlee
Copy link
Owner

When multiple models exist, pretrained() from the second doesn't work.

import tensorflow as tf
import tensornets as nets

inputs = tf.placeholder(tf.float32, [None, 224, 224, 3])
model1 = nets.ResNet50(inputs, scope='abc')
model2 = nets.Inception2(inputs, scope='def')
model3 = nets.DenseNet121(inputs, scope='ghi')

with tf.Session() as sess:
    sess.run(model1.pretrained())  # O
    try:
        sess.run(model2.pretrained())  # X
    except:
        print('X')
    try:
        sess.run(model3.pretrained())  # X
    except:
        print('X')
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