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

Pre-trained models and classify disappeared? #143

Closed
roland-KA opened this issue Apr 6, 2022 · 3 comments · Fixed by #164
Closed

Pre-trained models and classify disappeared? #143

roland-KA opened this issue Apr 6, 2022 · 3 comments · Fixed by #164

Comments

@roland-KA
Copy link

About a year ago I used Metalhead.jl for some demonstration purposes as described here: https://juliapackages.com/p/metalhead using the classify-function.

Now the pre-trained models as well as the classify-function seem to have disappeared. What happened to this and how can I do it now?

@darsnack
Copy link
Member

darsnack commented Apr 6, 2022

You will need to pin Metalhead to v0.5.x, since we made an intentional decision to remove datasets and the terminal viewer code from Metalhead.

As for the pre-trained models, we were initially going to keep the weights for the ones that are in the repo, but our testing indicated that the model predictions were not always correct. We opted to remove the weights as part of the complete breaking refactor in v0.6. You can still access the old pre-trained models with v0.5.x. In the coming weeks, we plan to add back pre-trained weights for VGG and ResNet variants (you can follow FluxML/MetalheadWeights#2 to track this).

If you want to use Metalhead v0.6+, then you can recreate the old functionality. The old Metalhead assumed that you had an installation of ImageNet. Assuming you have that and that imagenet_labels corresponds to a vector of all the possible ImageNet labels, you can define:

classify(model, input) = Flux.onecold(model(input), imagenet_labels)

If you can provide more details about your ImageNet installation, I can help you recreate the data loading as well (i.e. providing the imagenet_labels above).

@ToucheSir
Copy link
Member

our testing indicated that the model predictions were not always correct.

Not even that, the first few examples we pulled were flat out wrong. There's an issue about it kicking around on this repo if you're interested.

@roland-KA
Copy link
Author

Thanks all together for this really fast feedback! I will first try it with v0.5 and then have a look on the other alternative mentioned based on the current version.

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