Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fdd8782

Browse files
committedMay 16, 2021
✍️ update env util messages
1 parent 44b6875 commit fdd8782

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎tensorflow_asr/utils/env_util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ def setup_devices(devices: List[int], cpu: bool = False):
3737
cpus = tf.config.list_physical_devices("CPU")
3838
tf.config.set_visible_devices(cpus, "CPU")
3939
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")
4141
else:
4242
gpus = tf.config.list_physical_devices("GPU")
4343
if gpus:
4444
visible_gpus = [gpus[i] for i in devices]
4545
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")
4747

4848

4949
def setup_tpu(tpu_address=None):
@@ -53,7 +53,7 @@ def setup_tpu(tpu_address=None):
5353
resolver = tf.distribute.cluster_resolver.TPUClusterResolver(tpu="grpc://" + tpu_address)
5454
tf.config.experimental_connect_to_cluster(resolver)
5555
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')}")
5757
return tf.distribute.experimental.TPUStrategy(resolver)
5858

5959

0 commit comments

Comments
 (0)
Please sign in to comment.