File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -37,13 +37,13 @@ def setup_devices(devices: List[int], cpu: bool = False):
37
37
cpus = tf .config .list_physical_devices ("CPU" )
38
38
tf .config .set_visible_devices (cpus , "CPU" )
39
39
tf .config .set_visible_devices ([], "GPU" )
40
- logger .info ("Run on" , len (cpus ), " Physical CPUs" )
40
+ logger .info (f "Run on { len (cpus )} Physical CPUs" )
41
41
else :
42
42
gpus = tf .config .list_physical_devices ("GPU" )
43
43
if gpus :
44
44
visible_gpus = [gpus [i ] for i in devices ]
45
45
tf .config .set_visible_devices (visible_gpus , "GPU" )
46
- logger .info ("Run on" , len (visible_gpus ), " Physical GPUs" )
46
+ logger .info (f "Run on { len (visible_gpus )} Physical GPUs" )
47
47
48
48
49
49
def setup_tpu (tpu_address = None ):
@@ -53,7 +53,7 @@ def setup_tpu(tpu_address=None):
53
53
resolver = tf .distribute .cluster_resolver .TPUClusterResolver (tpu = "grpc://" + tpu_address )
54
54
tf .config .experimental_connect_to_cluster (resolver )
55
55
tf .tpu .experimental .initialize_tpu_system (resolver )
56
- logger .info ("All TPUs: " , tf .config .list_logical_devices (" TPU" ) )
56
+ logger .info (f "All TPUs: { tf .config .list_logical_devices (' TPU' ) } " )
57
57
return tf .distribute .experimental .TPUStrategy (resolver )
58
58
59
59
You can’t perform that action at this time.
0 commit comments