Loading pretrained models caused dead kernel

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:

  1. model = models.resnet18(pretrained = True)
  2. 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.

@chocolocked did u try updating ur conda environment? i guess it could be because of older packages or version mismatch in case u used pip for installing several libraries.try creating a fresh pytorch env i guess this might solve the issue.

1 Like