使用torch.load(model_path)时报错如上 解决: model = torch.load(model_path, map_location="cuda") 在后面加上map_location="cuda"