Deep learning vm with TPU

Viewed 52

please I need help setting up a deep learning vm (dlvm) with TPU, I've created the dlvm and a TPU node in the same zone, now when I access jupyter notebook it didn't use the TPU node but only the vm configuration (CPU and Ram). I was looking for an option to link the vm with TPU but I couldn't find it.

1 Answers

You need to use the --tpu-only flag:

Allocate a Cloud TPU only; use this only if you already have a VM available.

Afterwards, when you run your training, specify your TPU and it will be used.

Example:

python3 mnist_main.py \
  --tpu=$TPU_NAME \
  --model_dir=$MODEL_DIR \
  --data_dir=$DATA_DIR \
  --train_epochs=10 \
  --distribution_strategy=tpu \
  --download
Related