File size: 454 Bytes
c59e741 3c411b7 c59e741 3c411b7 |
1 2 3 4 5 6 7 8 9 10 11 |
import torch
# Load the checkpoint
checkpoint = torch.load('/workspace/train-wefadoor-master/anydoor/lightning_logs/version_4/checkpoints/300k_u.ckpt', map_location='cpu')
# Extract the state dictionary
state_dict = checkpoint['state_dict'] if 'state_dict' in checkpoint else checkpoint
# Save the state dictionary to a new checkpoint
torch.save(state_dict, '/workspace/train-wefadoor-master/anydoor/lightning_logs/version_4/checkpoints/300k_u.ckpt')
|