Skip to content

Commit c8c1351

Browse files
committed
solved bug for assigning trainer device
1 parent af44916 commit c8c1351

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chgnet/trainer/trainer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def __init__(
188188
self.device = "cpu"
189189
if self.device == "cuda":
190190
# Determine cuda device with most available memory
191-
device_with_most_available_memory = cuda_devices_sorted_by_free_mem()[0]
191+
device_with_most_available_memory = cuda_devices_sorted_by_free_mem()[-1]
192192
self.device = f"cuda:{device_with_most_available_memory}"
193193

194194
self.print_freq = print_freq

0 commit comments

Comments
 (0)