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

Releasing the model on torch.hub? #4

Open
gmberton opened this issue Oct 6, 2024 · 4 comments
Open

Releasing the model on torch.hub? #4

gmberton opened this issue Oct 6, 2024 · 4 comments
Assignees

Comments

@gmberton
Copy link

gmberton commented Oct 6, 2024

Hi @GaoShuang98 thank you for open sourcing your model!

Are there any plans to release the trained model on torch.hub? It is quite simple to do and allows people to use your model with two lines of code, allowing more people to use your model and helping to spread your work!
For example I did it for CosPlace, and the trained model can be automatically downloaded from anywhere without cloning the repo just like this

import torch
model = torch.hub.load("gmberton/cosplace", "get_trained_model", backbone="ResNet50", fc_output_dim=2048)

I'd like to add your model to the VPR-methods-evaluation repo and having the model on torch.hub would greatly help

@GaoShuang98 GaoShuang98 self-assigned this Oct 8, 2024
@GaoShuang98
Copy link
Owner

Hello, thank you for your recognition and constructive suggestions. I am also grateful that you are considering adding our work to the VPR-methods-evaluation repo. I will release the model on torch.hub as soon as possible🚀.

@GaoShuang98
Copy link
Owner

GaoShuang98 commented Oct 8, 2024

Hi @gmberton , the trained model has been released on torch.hub. I hope this meets your requirements and expectations.
Code to load the ViTb14-mix model from torch_hub:

import torch
model = torch.hub.load("GaoShuang98/DINO-Mix", "dino_mix", pretrained=True)

Thank you again for your valuable suggestions.

@gmberton
Copy link
Author

gmberton commented Oct 8, 2024

Hey thank you for your quick reply!
I tried to add it to my repo but I'm having two issues:

  1. If I use it on a machine with only one GPU, it says
    RuntimeError: Attempting to deserialize object on CUDA device 1 but torch.cuda.device_count() is 1. Please use torch.load with map_location to map your storages to an existing device.
    I think the model's weight were saved while on GPU 1, instead of moving them to CPU.

  2. Even when I run the model on a machine with 2 GPUs, I get low results (R@1 68.0 on St Lucia, 74.6 on Pitts30k). I tried with both normalizations of [0.5,0.5,0.5] and ImageNet's, but they both have low results. I resized the images to 224x224 otherwise it breaks. Do you know what the issue could be?

@GaoShuang98
Copy link
Owner

Hello, I conducted a loading test on the hubconf file in DINO-Mix and evaluated the accuracy of the loaded model. The test results indicate that the model loading is normal. For your reference, please see the test log and the hubconf_model_eval. I hope this can help you solve the issues. Thank you!

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