Skip to content

Commit

Permalink
In rexgen example: Enable training on CUDA-supporting maching and eva…
Browse files Browse the repository at this point in the history
…luation on non-CUDA-supporting machine. (#131)
  • Loading branch information
mar-volk committed Jan 19, 2021
1 parent 89be5a3 commit 367c79b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/reaction_prediction/rexgen_direct/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ def prepare_reaction_center(args, reaction_center_config):
n_layers=reaction_center_config['n_layers'],
n_tasks=reaction_center_config['n_tasks'])
reaction_center_model.load_state_dict(
torch.load(args['center_model_path'])['model_state_dict'])
torch.load(args['center_model_path'], map_location=torch.device('cpu'))['model_state_dict'])
reaction_center_model = reaction_center_model.to(args['device'])
reaction_center_model.eval()

Expand Down

0 comments on commit 367c79b

Please sign in to comment.