将gpu并行模型转换为单cpu/gpu模型
import torchdef convert_model(para_model,single_model): checkpoint = torch.load(para_model ,map_location=torch.device("cpu")) output={} for key,value in checkpoint['model'].items(): output[key.lstrip("module.")]=va