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

Not implemented load weight from own/custom path #163

Open
KirillHiddleston opened this issue Jun 26, 2024 · 1 comment
Open

Not implemented load weight from own/custom path #163

KirillHiddleston opened this issue Jun 26, 2024 · 1 comment

Comments

@KirillHiddleston
Copy link

KirillHiddleston commented Jun 26, 2024

Hi, if i want load weight by path
i load weight from https://github.com/chaofengc/IQA-PyTorch/releases/tag/v0.1-weights

pyiqa.create_metric('musiq-ava').net.load_state_dict(torch.load('/Users/user/Downloads/musiq_ava_ckpt-e8d3f067.pth'))

but still the model is downloaded from the link

# output
Downloading: "https://github.com/chaofengc/IQA-PyTorch/releases/download/v0.1-weights/musiq_ava_ckpt-e8d3f067.pth" to /Users/user/.cache/torch/hub/checkpoints/musiq_ava_ckpt-e8d3f067.pth

i wanna load weight from own path
u hardcode path url in model for example
https://github.com/chaofengc/IQA-PyTorch/blob/main/pyiqa/archs/clip_model.py#L15

@chaofengc
Copy link
Owner

You can safely ignore the downloaded weights because the they are only used in the model initialization and you reload your own weights using load_state_dict.

If you do not want to download original weights, simply use pyiqa.create_metric('musiq-ava', pretrained=False).

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