Skip to content

Commit 7383da7

Browse files
author
Han Wang
committed
handel the case of CUDA_VISIBLE_DEVICES=""
1 parent d650052 commit 7383da7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

source/train/Local.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ def get_resource ():
55
nodelist = [nodename]
66
gpus = os.getenv('CUDA_VISIBLE_DEVICES')
77
if gpus is not None :
8-
gpus = gpus.split(",")
9-
gpus = [int(ii) for ii in gpus]
8+
if gpus != "" :
9+
gpus = gpus.split(",")
10+
gpus = [int(ii) for ii in gpus]
11+
else gpus == "":
12+
gpus = []
1013
return nodename, nodelist, gpus

0 commit comments

Comments
 (0)