Questions tagged [tpu]

Use this tag for Tensor Processing Unit (TPU). TPU is an application-specific integrated circuit developed by Google.

421 questions
2
votes
0 answers

Keras model.fit causes InvalidArgumentError when training on TPU

When running the model.fit function an error is thrown. The main question is, what does this error mean? The code is run on a TPU V3-8 and uses Google cloud for data retrieval. I did try to look up the error on the web, however I could not find a…
Mark wijkhuizen
  • 373
  • 3
  • 10
2
votes
0 answers

Issue: Using TPU with OpenNMT-tf

I am trying to use free Google Colab TPU with OpenNMT-tf, it is an open source ecosystem for neural machine translation and neural sequence learning built on top of Tensorflow. TPU is not implemented yet, so I am trying to do that. I have created a…
Daniel abzakh
  • 430
  • 5
  • 10
2
votes
2 answers

Training with Global Batch Size on a TPU (tensorflow)

I've recently started a neural network project on Google Colab, and I discovered that I could use a TPU. I've been researching about how to use it and I discovered tensorflow's TPUStrategy (I'm using tensorflow 2.2.0), and have been able to…
2
votes
1 answer

TPU with Tensorflow v1

Please can anyone give me code to run TPU with Tensorflow V1 ? I'm trying this code but it works only with Tensorflow 2.0 : try: # TPU detection. No parameters necessary if TPU_NAME environment variable is # set: this is always the case on…
2
votes
0 answers

How to use cross entropy loss in tensorFlow when training on TPU?

I am trying to train transformer encoder (from here - https://www.tensorflow.org/tutorials/text/transformer) on TPU: def test(): train_step_signature = [ tf.TensorSpec(shape=(None, None), dtype=tf.int64), …
Andrey
  • 5,932
  • 3
  • 17
  • 35
2
votes
1 answer

Training loss is Nan using image segmentation in TPU using TFrecords

I am a beginner trying to work with TPUs using Tensorflow in Kaggle Kernels. I previously trained an Unet model using a dataset in GPU, and now I am trying to implement that in TPU. I made a tfrecord out of the dataset images and mask, and the…
2
votes
1 answer

torch_xla rendezvous at the end of a function causes "Failed to meet rendezvous" error

I'm currently trying to run some code on multiple tpu cores on Google Colab but I seem to get an error when the synchronization code (xm.rendezvous) is called at the end of the target function but now when the synchronization code is at the top.…
btomtom5
  • 842
  • 8
  • 16
2
votes
1 answer

TensorFlow 2.1 using TPUEstimator: RuntimeError: All tensors outfed from TPU should preserve batch size dimension, but got scalar Tensor

I just converted an existing project from TF 1.14 to TF 2.1 which uses the TPUEstimator API. After making the conversion, testing locally (i.e. use_tpu=False) runs successfully. However, I am getting errors when running on Google Cloud TPU (i.e.…
2
votes
1 answer

3D convolutional models with the Coral Edge TPU?

I just picked up a Google Coral USB Accelerator to learn ML without spending a lot of money on a new PC/GPU (I still have a Macbook Air from 2014 and it's laughably slow) I'd like to try to build on the work done on this video shot detector model…
2
votes
0 answers

How to use TPU Pod in Polyaxon

Did anyone manage to use TPU Pod (eg. 32 v2 TPU cores) in experiments on GKE in Polyaxon experiment? I have a lot of problems when trying to do that. I'm using Pytorch. Eg., you need to know the TPU Pod name to start training with TPUs…
2
votes
1 answer

RuntimeError: Failed to serialize message

Im trying to use TPU in google colab so after doing some preprocess in numpy format im trying to convert into tensorflow format by using train_setx = tf.data.Dataset.from_tensor_slices(trainx) which has 90k images of size 225*225*1. if i try to…
2
votes
0 answers

Colab TPU error - InvalidArgumentError: Unsupported data type for TPU: string, caused by output cond_8/Identity_1:0

I get above error in colab TPU from the code below. Original model had epochs, steps_per_epoch and batch but removed that while debugging. Not sure what the issue is as I do not see a string. None TPU version of code works. Most of the code is stock…
2
votes
2 answers

GCP and TPU, experimental_connect_to_cluster give no response

I am trying to use TPU on GCP with tensorflow 2.1 with Keras API. Unfortunately, I am stuck after creating the tpu-node. In fact, it seems that my VM "see" the tpu, but could not connect to it. The code I am using : resolver =…
Shiro
  • 795
  • 1
  • 7
  • 23
2
votes
1 answer

How can I merge the results from strategy in Tensorflow 2

I'm trying to use strategy in Tensorflow. I know how I can get summation and mean value of the result from each replica. However, if the result of each replica is array, how can I merge these arrays from each replica to one array? The following is…
MrJasonLi
  • 21
  • 3
2
votes
2 answers

how to use torchaudio with torch xla on google colab tpu

I'm trying to run a pytorch script which is using torchaudio on a google TPU. To do this I'm using pytorch xla following this notebook, more specifically I'm using this code cell to load the xla: !pip install torchaudio import os assert…
Laurence
  • 367
  • 4
  • 13