Skip to content

Commit

Permalink
fix: load checkpoint on right device
Browse files Browse the repository at this point in the history
  • Loading branch information
ImahnShekhzadeh committed May 20, 2024
1 parent d0b0da2 commit 333d73f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/images/cifar10/compute_fid.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
# Load the model
PATH = f"{FLAGS.input_dir}/{FLAGS.model}/{FLAGS.model}_cifar10_weights_step_{FLAGS.step}.pt"
print("path: ", PATH)
checkpoint = torch.load(PATH)
checkpoint = torch.load(PATH, map_location=device)
state_dict = checkpoint["ema_model"]
try:
new_net.load_state_dict(state_dict)
Expand Down

0 comments on commit 333d73f

Please sign in to comment.