-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Invalid hash code when using EfficientNet #696
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
Comments
Hi @jdrp , Looks like a few people are getting this issue with the latest version of You can find a solution here: #693 (reply in thread) In short, This should help fix it: Overriding torchvision.models._api.WeightsEnum.get_state_dict() should do the trick, LMK if it doesn't work from torchvision.models import efficientnet_b0, EfficientNet_B0_Weights
from torchvision.models._api import WeightsEnum
from torch.hub import load_state_dict_from_url
def get_state_dict(self, *args, **kwargs):
kwargs.pop("check_hash")
return load_state_dict_from_url(self.url, *args, **kwargs)
WeightsEnum.get_state_dict = get_state_dict
efficientnet_b0(weights=EfficientNet_B0_Weights.IMAGENET1K_V1)
efficientnet_b0(weights="DEFAULT") Source: pytorch/vision#7744 (comment) |
That worked, thanks for the quick help! |
that worked thank you !! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am currently on step 3.2 of 06. PyTorch Transfer Learning. When I try to run this code on a Colab notebook:
I keep getting the following error:
Both the expected and got hash values stay the same if I run the code again.
My torch version is 2.1.0+cu118 and torchvision is 0.16.0+cu118
The text was updated successfully, but these errors were encountered: