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

How to download the pretrained weights? #31

Closed
lucasjinreal opened this issue Oct 30, 2018 · 2 comments
Closed

How to download the pretrained weights? #31

lucasjinreal opened this issue Oct 30, 2018 · 2 comments

Comments

@lucasjinreal
Copy link

I wanna test yolo2 or yolov3 combined with mobilenetv2, as following codes, how to download the models?

import tensorflow as tf
import tensornets as nets

inputs = tf.placeholder(tf.float32, [None, 416, 416, 3])
model = nets.YOLOv2(inputs, nets.mobilenets.MobileNet75v2)

img = nets.utils.load_img('cat.jpg')

with tf.Session() as sess:
    sess.run(model.pretrained())

    preds = sess.run(model, {inputs: model.preprocess(img)})
    boxes = model.get_boxes(preds, img.shape[1:3])

    print(boxes)
@taehoonlee
Copy link
Owner

Thank you for trying TensorNets, @jinfagang. There are no pre-trained weights for yolo with mobilenetv2. In order to train them, this example would be helpful. The point is to exploit the pre-trained weights only for the stem layers as follows:

sess.run(tf.global_variables_initializer())
sess.run(model.stem.pretrained())

@taehoonlee
Copy link
Owner

@jinfagang, I'll close the issue for now. Please feel free to open it again at any time if you have additional comments.

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