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

Downloading trained models #2

Open
gmberton opened this issue Nov 8, 2023 · 5 comments
Open

Downloading trained models #2

gmberton opened this issue Nov 8, 2023 · 5 comments

Comments

@gmberton
Copy link

gmberton commented Nov 8, 2023

Thank you for the repo!
I don't have a baidu account, is there any other way to download the model's weights? If I send you a Google Drive account, could you upload the weights there?

@Reza-Zhu
Copy link
Owner

Reza-Zhu commented Nov 9, 2023

Hi gmberton,
Thank you for your interest in our model. I apologize for any inconvenience caused by baidu account. If you are able to provide me with a Google Drive account, I would be happy to upload the weights there for you to access instead.

email: [email protected]

@gmberton
Copy link
Author

gmberton commented Nov 9, 2023

That would be perfect: could you upload it here?
https://drive.google.com/drive/folders/1w58oK6D3SQrKYYtlYPjFxZpNymFvZEoh?usp=sharing

@Reza-Zhu
Copy link
Owner

Reza-Zhu commented Nov 9, 2023

Upload Completed, please check the drive.

@gmberton
Copy link
Author

gmberton commented Nov 9, 2023

Thanks a lot! I am able to download the weights.
I am wondering, how can I load them in the model? I mean for a weight like MBEG-B2-1652.pth, what model from model_.py should I initialize? My guess is that if I do something like this it should work

import torch
import model_
weights_path = "MBEG-B2-1652.pth"
weights = torch.load(weights_path)
model = model_...... # TODO
model.load_state_dict(weights)

@Reza-Zhu
Copy link
Owner

# model_.py Line 42

class EVA(nn.Module):
    def __init__(self, classes, drop_rate, share_weight=True):
        super(EVA, self).__init__()
        self.model_1 = timm.create_model('eva02_large_patch14_448.mim_m38m_ft_in22k_in1k',pretrained=True,
    num_classes=0)
        if share_weight:
            self.model_2 = self.model_1
        else:
            self.model_2 = timm.create_model('eva02_large_patch14_448.mim_m38m_ft_in22k_in1k',pretrained=True,
    num_classes=0)
        self.classifier = ClassBlock(1024, classes, drop_rate)
image

https://huggingface.co/timm/eva02_base_patch14_448.mim_in22k_ft_in22k_in1k (Check Model Comparison)

In model_.py, you should replace the string ('eva02_large_patch14_448.mim_m38m_ft_in22k_in1k') at self.model_1 = timm.create_model('eva02_large_patch14_448.mim_m38m_ft_in22k_in1k',pretrained=True, num_classes=0) to other EVA serise weights. For the correspondence between MBEG and EVA, please see Table1 in the paper. The name of EVA weight in timm could be find in above huggingface link.

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