Closed MikuAuahDark closed 1 year ago
import torch
if __name__ == '__main__':
input_path = fr"D:\backup\tannhauser\G_4000.pth"
output_path = fr"D:\backup\tannhauser\tannhauser.pth"
checkpoint_dict = torch.load(input_path, map_location='cpu')
checkpoint_dict_new = {}
for k, v in checkpoint_dict.items():
if k == "optimizer":
print(f"remove optimizer")
continue
checkpoint_dict_new[k] = v
torch.save(checkpoint_dict_new, output_path)
Sweet, thank you very much.
Thank you for the previous assistance. Now I have my own model.
However the size of the model is large (almost 500MB). How to reduce the model size?