I tried to load pre-trained resnet18/50 for feature extraction for MIL. but everytime I used ‘pretrained=True’. it gave me a dead kernel. (it used to work perfectly)
I’ve tried two ways:
- model = models.resnet18(pretrained = True)
- state_dict = torch.hub.load_state_dict_from_url(url = ‘https://download.pytorch.org/models/resnet50-19c8e357.pth’, model_dir= ‘data/’, file_name = ‘resnet50.pth’)
model= models.resnet50()
model.load_state_dict(torch.load(‘data/resnet50.pth’))
Also i tried like Vgg18 it threw me the same error also. Any help would be greatly appreciated.