Skip to content

Commit

Permalink
solved bug for assigning trainer device
Browse files Browse the repository at this point in the history
  • Loading branch information
BowenD-UCB committed Feb 22, 2024
1 parent af44916 commit c8c1351
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chgnet/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def __init__(
self.device = "cpu"
if self.device == "cuda":
# Determine cuda device with most available memory
device_with_most_available_memory = cuda_devices_sorted_by_free_mem()[0]
device_with_most_available_memory = cuda_devices_sorted_by_free_mem()[-1]
self.device = f"cuda:{device_with_most_available_memory}"

self.print_freq = print_freq
Expand Down

0 comments on commit c8c1351

Please sign in to comment.