重新训练的pth模型文件,怎么转成bin文件?因为我看到模型文件是pytorch_model.bin的
import torch import sys
#pth文件路径 model_path = sys.argv[1] #bin文件路径 out_path = sys.argv[2]
checkpoint = torch.load(model_path, map_location='cpu') state_dict = checkpoint['state_dict'] torch.save(state_dict, out_path)