Skip to content

Commit

Permalink
map location to cpu when load checkpoint (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
ly015 authored Nov 10, 2021
1 parent c0d5e4c commit ec2d4d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmpose/apis/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def init_pose_model(config, checkpoint=None, device='cuda:0'):
model = build_posenet(config.model)
if checkpoint is not None:
# load model checkpoint
load_checkpoint(model, checkpoint, map_location=device)
load_checkpoint(model, checkpoint, map_location='cpu')
# save the config in the model for convenience
model.cfg = config
model.to(device)
Expand Down

0 comments on commit ec2d4d0

Please sign in to comment.