06 Pytorch Transfer Learning -> Setting up a pretrained model #771
Unanswered
avishekiitism
asked this question in
Q&A
Replies: 3 comments 2 replies
-
NEW: Setup the model with pre-trained weights and send it to the target device (torchvision v0.13+) Hi I am encountering the same error. Can someone help me with this? |
Beta Was this translation helpful? Give feedback.
2 replies
-
Hey, I have same problem, but according to PyTorch repo this bug has been reported and its going to be fixed soon. To bypass this bug for now you should simply run this code one cell above :)
Hope its helps :) Cheers! |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks man!
*Premsai Karampudi**, MBA, RIPC*
…On Mon, 29 Jan 2024 at 6:52 PM, DarekW90 ***@***.***> wrote:
Hey, I have same problem, but according to PyTorch repo this bug has been
reported and its going to be fixed soon.
(pytorch/vision#7744 (comment)
<pytorch/vision#7744 (comment)>)
To bypass this bug for now you should simply run this code:
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")
One cell above :) hope its helps :)
Cheers!
—
Reply to this email directly, view it on GitHub
<#771 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWXSCR7YDQQRSRXP2M7O4FLYQ6PBHAVCNFSM6AAAAABBBLBIBGVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DEOBSGYYDS>
.
You are receiving this because you commented.Message ID:
<mrdbourke/pytorch-deep-learning/repo-discussions/771/comments/8282609@
github.com>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My error
RuntimeError: invalid hash value (expected "3dd342df", got "7f5810bc96def8f7552d5b7e68d53c4786f81167d28291b21c0d90e1fca14934")
My code
Beta Was this translation helpful? Give feedback.
All reactions