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

06-pytorch-transfer-learning: got some error in [3.2 Setting up a pretrained model] (torch:2.1.0+cu121, torchvision:0.16.0+cu121) #770

Open
stleafz opened this issue Dec 23, 2023 · 3 comments

Comments

@stleafz
Copy link

stleafz commented Dec 23, 2023

I followed the video("Setting Up a Pretrained Model with Torchvision") and tried to run the code :

model = torchvision.models.efficientnet_b0(weights=weights)
model

then got the error message:
invalid hash value (expected "3dd342df", got "7f5810bc96def8f7552d5b7e68d53c4786f81167d28291b21c0d90e1fca14934")

It seems like a new bug, and it could be fixed temporarily by overriding torchvision.models._api.WeightsEnum.get_state_dict()
source:pytorch/vision#7744 (comment)
I hope this could be helpful to those who got the same error.

@avishekiitism
Copy link

thanks

@mrdbourke
Copy link
Owner

Thank you for the heads up!

A few other people are getting that too.

See the following issue/comment for further code/solution: #696 (comment)

@mustious
Copy link
Contributor

mustious commented Feb 4, 2024

If you still face the same issue, after running the first code cell to install the packages, try to Restart Session on Google Colab. Then, run the imports again.

The issue seems to be with torchvision v0.16.0 specifically. Other higher versions work seamlessly. pytorch/vision#7744 (comment)

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

4 participants