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

Cannot run imagenet_pretrained_vgg example #160

Open
RXZ2020 opened this issue Nov 21, 2020 · 5 comments · May be fixed by #148
Open

Cannot run imagenet_pretrained_vgg example #160

RXZ2020 opened this issue Nov 21, 2020 · 5 comments · May be fixed by #148
Assignees

Comments

@RXZ2020
Copy link

RXZ2020 commented Nov 21, 2020

I was trying to run https://github.com/google/objax/blob/master/examples/image_classification/imagenet_pretrained_vgg.py

But received an error:


FileNotFoundError Traceback (most recent call last)
in ()
38
39 # Load model with pretrained weights and make a prediction.
---> 40 model = vgg.VGG19(pretrained=True)
41 logit = model(img)
42 prob = objax.functional.softmax(logit)[0]

/usr/local/lib/python3.6/dist-packages/objax/zoo/vgg.py in init(self, pretrained)
55 if not os.path.exists(_VGG19_NPY):
56 raise FileNotFoundError(
---> 57 'You must download vgg19.npy from %s and save it to %s' % (_VGG19_URL, _VGG19_NPY))
58 if not os.path.exists(_SYNSET_PATH):
59 request.urlretrieve(_SYNSET_URL, _SYNSET_PATH)

FileNotFoundError: You must download vgg19.npy from https://github.com/machrisaa/tensorflow-vgg and save it to ./objax/zoo/pretrained/vgg19.npy

Is this normal? How should I proceed from here.

@aterzis-google
Copy link
Collaborator

@RXZ2020 please download vgg19.npy from the URL mentioned in the error message and save it to ./objax/zoo/pretrained/vgg19.npy

@aterzis-google aterzis-google self-assigned this Nov 21, 2020
@david-berthelot
Copy link
Contributor

You know I've come to realize that's not really practical. If you install Objax with pip install, the path where to save may not be obvious.

I've seen other frameworks create their own area say $HOME/.objax, maybe it something we should think about.

@RXZ2020
Copy link
Author

RXZ2020 commented Nov 21, 2020

@RXZ2020 please download vgg19.npy from the URL mentioned in the error message and save it to ./objax/zoo/pretrained/vgg19.npy

Hi, how do you do this if I was running it on Colab? Do I create an objax folder in Google drive or elsewhere?

@david-berthelot
Copy link
Contributor

Yes, good point. We should make Objax download it for you otherwise it won't be useful in a Colab.

@aterzis-google
Copy link
Collaborator

If installing Objax with pip install, then need to copy under site-packages/objax/zoo/pretrained.

Not sure what the copyright for pretrained VGG is and whether we can include it in the objax package.

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

Successfully merging a pull request may close this issue.

3 participants