Skip to content

Commit

Permalink
Fix device placement when loading
Browse files Browse the repository at this point in the history
  • Loading branch information
ikostrikov committed Feb 4, 2021
1 parent b1152f8 commit b25c006
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion enjoy.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@

# We need to use the same statistics for normalization as used in training
actor_critic, ob_rms = \
torch.load(os.path.join(args.load_dir, args.env_name + ".pt"))
torch.load(os.path.join(args.load_dir, args.env_name + ".pt"),
map_location='cpu')

vec_norm = get_vec_normalize(env)
if vec_norm is not None:
Expand Down

0 comments on commit b25c006

Please sign in to comment.