Questions tagged [tpu]

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

tpu
219 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
10 votes
2 answers
2k views

TPU: Is there a way to use a Coral USB Accelerator in android device?

I want to use USB Coral accelerator in Android Device to use CNN in my Android applications. Is it available to use? If you guys to know it. Please Let me know. Thanks.
Jonghoon's user avatar
  • 101
8 votes
0 answers
1k views

Keras model not works well on TPU since June 14

I notice that this code cannot work since June 14 as it says: 'Model' object has no attribute 'target_tensors'. I change another way to use the TPU distribution strategy following https://colab....
Pengfei CHEN's user avatar
6 votes
3 answers
2k views

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

I'm trying to do some basic character classification on google colab with a TPU. I'm getting the following error: InvalidArgumentError: Unsupported data type for TPU: double, caused by output cond_8/...
user3413723's user avatar
  • 11.7k
5 votes
2 answers
1k views

Kaggle TPU Unavailable: failed to connect to all addresses

I'm a newbie to ML. When trying to complete digit recognition with TPU method, I encountered following problems. resolver = tf.distribute.cluster_resolver.TPUClusterResolver(tpu='') tf.config....
Dacian Peng's user avatar
5 votes
0 answers
393 views

Using a TPus with SpaCy

Is it possible to use a tpu in spacy... I know that you can use a gpu with spacy.prefer_gpu(). Is there something similar to this for tpu? Thanks in advance!
pineapps's user avatar
4 votes
1 answer
5k views

Google USB Coral TPU installation - unable to install PyCoral library

Environment: Ubuntu 20.04, Coral TPU USB accelerator I'm following these instructions - I was able to install the TPU Runtime after some Googling around unsigned package errors. However, when I try to ...
Chad's user avatar
  • 41
4 votes
0 answers
524 views

Dynamic Spatial Convolution is not supported on TPU

I'm trying to fit a Keras (TF 2.3.1) model for image classification with multiple binary labels as output. The model consists of an Xception CNN + attention layer + dense classifier, and hitting an ...
Diego Roscardi's user avatar
4 votes
1 answer
2k views

tensorflow error: "No OpKernel was registered to support Op 'TPUReplicatedInput'" when restoring model

(Novice question; sorry in advance.) I have a pretrained (BigGAN) tensorflow model that another user developed to create images, and I would like to use it to generate new images. (If it helps to ...
jspi's user avatar
  • 51
4 votes
1 answer
1k views

While running on a TPU instance on Google Colab getting InternalError: Failed to serialize message

I'm trying to train a model on Google Colab using a TPU for a college project. I'm using TensorFlow 1.15.0. Now, as I understand from the TPU examples, I'm converting the tf.keras.models.Model ...
Bhargav Desai's user avatar
4 votes
0 answers
401 views

AttributeError: KerasTPUModel' object has no attribute _ckpt_saved_epoch

I am trying to train a model on Google Colab, in order to play around with training on TPU. However, I am running into the following error: AttributeError Traceback (most ...
SilverTear's user avatar
4 votes
0 answers
1k views

Best way to train a CNN on Google Colab TPU

I am trying to train a CNN (ResNet50 for now) using Keras on Google Colab with their TPU support. The TPU VM on Colab has a small local disk size, so I cannot fit my training images on it. I tried ...
kg_sYy's user avatar
  • 1,167
4 votes
0 answers
400 views

Using SessionRunHook with TPU

I have developed a SessionRunHook which I attach to TPUEstimator. SessionRunHook works perfectly fine on CPU, however if I use TPU I get an error: INFO:tensorflow:Error recorded from outfeed: ...
Donatas Repečka's user avatar
3 votes
1 answer
600 views

How to fix "pop from empty list" error while using Keras tuner search method with TPU in google colab?

I previously was able to run the search method of keras tuner on my model with GPU runtime of Google colab. But when I switched to the TPU runtime, I get the following error. I haven't been able to ...
Nahian Rifaat's user avatar
3 votes
0 answers
492 views

RaggedTensor on TPU

I am trying to train a neural network using TensorFlow that takes as input (tf.keras.layers.Input) a RaggedTensor. It works fine on CPU and GPU but I am really strugling to make it work on TPU. I ...
Vince.Bdn's user avatar
  • 1,165
3 votes
1 answer
827 views

TPU training in colab, custom model, data from my own GCP account: Cell just seems to hang, no progress or error message

I am trying to train on a colab TPU using data from my GCP account. When I run the cell that starts the training, the cell just seems to hang, with no progress. I put a very low number of steps, so ...
SantoshGupta7's user avatar
3 votes
0 answers
937 views

Error when running on TPU, "NotImplementedError: TPUStrategy.run(fn, ...) does not support pure eager execution....."

I am trying to train my model over a colab TPU, but I am running into NotImplementedError: TPUStrategy.run(fn, ...) does not support pure eager execution. please make sure the function passed into ...
SantoshGupta7's user avatar
3 votes
0 answers
1k views

"AttributeError: Tensor.name is meaningless when eager execution is enabled." when training on TPU at "self.optimizer.apply_gradients"

I have code that works fine on GPU, but for TPU, I get at error starting at : self.optimizer.apply_gradients(zip(gradients, trainable_vars)) Which says AttributeError: Tensor.name is meaningless when ...
SantoshGupta7's user avatar
3 votes
1 answer
408 views

How to train Keras model on TPU on Google Colab ?, do I need to change my model configuration?(tinyYolo-v3)

I am not very familiar to model training on Google Colaboratory, I am currently trying to train a Keras (tinyYolov3) model using TPU, from my understanding I need get one of of the available TPU ...
RichHacker's user avatar
3 votes
0 answers
590 views

Running keras model on colab TPU

I am currently trying to train a convolutional neural network CNN using Keras and the Google Colab GPU. I found this article that discussed the option to increase the training time that is needed to ...
Jonas's user avatar
  • 67
3 votes
0 answers
464 views

How to feed data for Tensorflow for multiple inputs for tpu?

I am trying to feed data for multiple inputs (2 inputs) for Keras (Tenserflow) for TPU training, but I get this error: ValueError: The dataset returned a non-Tensor type ((<class 'tensorflow....
Michele Cappelchi's user avatar
3 votes
1 answer
249 views

How to use keras model inside other model in TPU

I am trying to convert a keras model to tpu model in google colab, but this model has another model inside. Take a look at the code: https://colab.research.google.com/drive/...
Felix Rodriguez Joleanes's user avatar
2 votes
0 answers
179 views

InvalidArgumentError after step 6 during my training on TPU at Kaggle

I am getting an error when I train my model with TPU on kaggle. I already looked around the internet but can get any solution. Note that it is working if I use GPU but I run OOM error. Here is the ...
stic-lab's user avatar
  • 491
2 votes
0 answers
298 views

How to see VRAM of google tpu?

Is it possible to see the VRAM of google TPU being used? In case of using gpu, we can identify how much memory is being used using nvidia-smi or gpustat, but I don't know how to identity it in tpu. I ...
Seungwoo Ryu's user avatar
2 votes
1 answer
85 views

Do TFX pipelines support training on TPUs?

I am new to TFX and I would like to know if it's possible to create a TFX pipeline that can train Keras models on TPUs nodes using TPUStrategy from a TPUClusterResolver. Looking at TFX documentation, ...
TheDude's user avatar
  • 51
2 votes
0 answers
755 views

Tokenize dataset using map on tf.data.Dataset.from_tensor_slices(....)

Note: I am using the free TPU provided on Kaggle. I want to tokenize the text using transformers such that I tokenize only the batch while training the model instead of first tokenizing the whole ...
Abhishek Prajapat's user avatar
2 votes
0 answers
95 views

How to gather prediction result on TPU (Pytorch)?

I'm trying to fine-tune my bert-based QA model(PyTorch) with Tpu v3-8 provided by Kaggle. In the validation process I used a ParallelLoader to make predictions on 8 cores at the same time. But after ...
佩特微's user avatar
2 votes
1 answer
794 views

Tensorflow load saved model, Predict and Evaluate. Too low accuracy on test?

I have trained my model on TPU and result seems good for testing. Dataset has 5 classes and result shows that: accuracy: 0.9867 - sparse_categorical_accuracy: 0.9867 - loss: 0.0412 - val_accuracy: 0....
Nobat's user avatar
  • 51
2 votes
1 answer
941 views

Kaggle TPU: failed to connect to all addresses

I'm facing some problems while trying to fit my model using TPU on kaggle. Tpu already's initialized: try: tpu = tf.distribute.cluster_resolver.TPUClusterResolver() print(f'Running on TPU {tpu....
rdn's user avatar
  • 33
2 votes
0 answers
161 views

Training a keras model using TPU pods?

I was wondering if anyone has an example of using a keras model on a TPU pod? I have a model creating method which returns a keras model which is compiled within a TPU strategy scope, as recommended ...
st0ne's user avatar
  • 116
2 votes
0 answers
313 views

How to reduce TPU idle time?

I'm getting like 99.7% TPU idle time with my training code (https://github.com/ksjae/KoGPT2-train). What are the general methods used to reducing IDLE time? How can I(or any user in general) reduce it ...
efe23eds's user avatar
2 votes
0 answers
302 views

Google Colab don't get the file from GCS Bucket

I am trying to train a model from this repo with TPU which requires all input files and the model directory must use a cloud storage bucket. I did create a bucket and upload all the files of the model....
huy's user avatar
  • 1,772
2 votes
0 answers
103 views

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 ...
Mark wijkhuizen's user avatar
2 votes
0 answers
218 views

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 ...
Daniel abzakh's user avatar
2 votes
0 answers
153 views

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), ...
Andrey's user avatar
  • 6,159
2 votes
1 answer
153 views

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 ...
Nicholas Breckwoldt's user avatar
2 votes
1 answer
418 views

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 ...
Carini's user avatar
  • 21
2 votes
0 answers
242 views

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 ...
Antonio Jurić's user avatar
2 votes
0 answers
403 views

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 ...
user13552728's user avatar
2 votes
1 answer
555 views

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 ...
MrJasonLi's user avatar
2 votes
1 answer
2k views

Segmentation Fault Tensorflow Lite

Hi I got the following error: "Segmentation fault" on my Raspberry Pi 4 Model B. I am following David Tian's Guide to build a Smart Robot Car which uses Deep Learning. Some important informations: ...
Micha93's user avatar
  • 638
2 votes
0 answers
271 views

Using TensorFlow 2.0 keras: NotFoundError FetchOutputs node : not found [Op:AutoShardDataset]

I am trying to make use of TPU on Google Colab. I have followed the guide official tensorflow guide to use tpu as follows: resolver = tf.distribute.cluster_resolver.TPUClusterResolver(tpu='grpc://' ...
Shashikant Kadam's user avatar
2 votes
0 answers
307 views

TPU in colab fails while GPU works

I am working on a modified version of the TPU fmnist example. While the original works fine, in my version I reduce the frequency of some classes according to a percentile (also omitting some classes, ...
Dinari's user avatar
  • 2,557
2 votes
1 answer
701 views

No OpKernel was registered to support Op 'TPUReplicateMetadata' used by node TPUReplicateMetadata

When I run the following .ipynb: https://colab.research.google.com/drive/1DpUCBm58fruGNRtQL_DiSVbT90spdZgm I got: No OpKernel was registered to support Op 'TPUReplicateMetadata' used by node ...
user avatar
2 votes
0 answers
277 views

'strided_slice_19' (op: 'StridedSlice') with input shapes

I tried to use keras.preprocessing.image.ImageDataGenerator on TPU,but i get this error from the first epoch.the same code work with jupyter notebook but take hours for trainig. My MODEL: model = ...
Youssef Mhamdi's user avatar
2 votes
0 answers
277 views

Using TPU on GKE: Error recorded from infeed: Socket closed

Once in a while our GKE TPUEstimator based training job using TPUs fail with: Error recorded from infeed: Socket closed An error was raised. This may be due to a preemption in a connected worker or ...
Prashast's user avatar
  • 5,655
2 votes
0 answers
333 views

Is it possible to run python tensorflow code on TPU without using the Estimator API?

I have spent weeks now trying to write a Python level Tensorflow code that could communicate with TPUs directly. How would it be possible to implement the system that could run on a TPU without the ...
user3815403's user avatar
2 votes
1 answer
2k views

Converting code from keras to tf.keras causes problems

I am learning machine translation in Keras using the code from this article. The article's code works fine on GPU and CPU as-is. Now I want to take advantage of Google Colab TPUs. The code doesn't ...
Lars Ericson's user avatar
  • 2,034
2 votes
1 answer
953 views

RPC failed with status = "Unavailable: Socket closed" Error when training FairSeq RoBERTa on Cloud TPU using PyTorch

I followed the tutorials "Pre-training FairSeq RoBERTa on Cloud TPU using Pytorch" to setup a Preemptible (v2-8) TPU env and train my RoBERTa model. The PyTorch env is based on torch-xla-1.6 ...
user3786340's user avatar
1 vote
0 answers
45 views

Kaggle GPU and TPU does not work, executes with CPU

My goal is to make an LSTM autoencoder using tensorflow.keras. For this I want to use the kaggle GPUs/TPUs, however, even though I have the cunta verified and select an accelerator it runs with the ...
yeray's user avatar
  • 75
1 vote
0 answers
38 views

ERROR: (gcloud.compute.tpus.tpu-vm.create) PERMISSION_DENIED: Permission denied on 'locations/us-central1-a\' (or it may not exist). and other Error

I am attempting to follow the instructions to set up a gcloud tpu system from this tutorial. I have followed each of the instructions up to the Prepare to create a Cloud TPU section. It is at this ...
Gavic1's user avatar
  • 21

1
2 3 4 5