pretrained_model_dict = torch.load(model_path, map_location='cpu')
只需加上如下所示就可以了
map_location = 'cpu'