Skip to content

Commit

Permalink
added map_location=str(device) in torch.load()
Browse files Browse the repository at this point in the history
  • Loading branch information
ngshya authored Jan 15, 2020
1 parent b046704 commit 094f0b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion caption.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def visualize_att(image_path, seq, alphas, rev_word_map, smooth=True):
args = parser.parse_args()

# Load model
checkpoint = torch.load(args.model)
checkpoint = torch.load(args.model, map_location=str(device))
decoder = checkpoint['decoder']
decoder = decoder.to(device)
decoder.eval()
Expand Down

0 comments on commit 094f0b9

Please sign in to comment.