Preparing for TFJob

strategy = tf.distribute.experimental.MultiWorkerMirroredStrategy()
task_type = strategy.cluster_resolver.task_type
task_id = strategy.cluster_resolver.task_id
global_batch_size = per_worker_batch * strategy.num_replicas_in_sync
-bash: syntax error near unexpected token `(’
-bash: task_type: command not found
-bash: task_id: command not found
-bash: global_batch_size: command not found

Getting this error


Hi Sandeep! Welcome to the community and sorry for the late reply. I think you may have figured this out by now. That block of code is not meant to run in the command line. It is just part of the script that is highlighted in the instructions. There’s an ungraded lab in class that demonstrates how this works. Hope this clarifies it. Thanks!

1 Like