google-cloud-tpu

How use TPU in google colab

孤人 提交于 2020-01-22 05:51:45
问题 Google colab brings TPUs in the Runtime Accelerator. I found an example, How to use TPU in Official Tensorflow github. But the example not worked on google-colaboratory. It stuck on following line: tf.contrib.tpu.keras_to_tpu_model(model, strategy=strategy) When I print available devices on colab it return [] for TPU accelerator. Does anyone knows how to use TPU on colab? 回答1: Here's a Colab-specific TPU example: https://colab.research.google.com/github/tensorflow/tpu/blob/master/tools/colab

ValueError: Operation u'tpu_140462710602256/VarIsInitializedOp' has been marked as not fetchable

萝らか妹 提交于 2019-12-31 02:00:33
问题 The code works fine on GPU and CPU.But when I use keras_to_tpu_model function to make the model able to run on TPU, the error occurred. This is the full output on colab:https://colab.research.google.com/gist/WangHexie/2252beb26f16354cb6e9ba2639970e5b/tpu-error.ipynb Change runtype to TPU,I think this can be reproduced. Code on github:https://github.com/WangHexie/DHNE/blob/master/src/hypergraph_embedding.py#L60 You can test the code on GPU by changing to the gpu branch. Traceback Traceback

TensorFlow object detection training error with TPU

ⅰ亾dé卋堺 提交于 2019-12-22 07:51:22
问题 I'm following along with Google's object detection on a TPU post and have hit a wall when it comes to training. Looking at the job logs, I can see that ml-engine runs a ton of pip installs for various packages, provisions a TPU, and then submits the following: Running command: python -m object_detection.model_tpu_main --model_dir=gs://{MY_BUCKET}/train --tpu_zone us-central1 --pipeline_config_path=gs://{MY_BUCKET}/data/pipeline.config --job-dir gs://{MY_BUCKET}/train It then errors with:

How to save a Tensorflow Checkpoint file from Google Colaboratory in when using TPU mode?

允我心安 提交于 2019-12-13 12:15:36
问题 When I use saver = tf.train.Saver() and save_path = saver.save(session, "checkpointsFolder/checkpoint.ckpt") I get a UnimplementedError (see above for traceback): File system scheme '[local]' not implemented error Here is the full error --------------------------------------------------------------------------- UnimplementedError Traceback (most recent call last) /usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args) 1333 try: -> 1334 return fn

TPU custom chip available with Google Cloud ML

天大地大妈咪最大 提交于 2019-12-11 04:46:08
问题 Which type of Hardware is used as part of Google Cloud ML when using TensorFlow? Only CPU or Tensor Processing Unit (custom cards) are also available? cf this article 回答1: Cloud TPUs are available to the public as of 2018-06-27: https://cloud.google.com/tpu/docs/release-notes This was announced at Google Next '18: https://www.blog.google/products/google-cloud/empowering-businesses-and-developers-to-do-more-with-ai/ 回答2: Cloud ML currently focuses on CPUs. GPUs and TPUs will be available in

Op type not registered 'BatchDatasetV2'

半世苍凉 提交于 2019-12-11 01:39:49
问题 I’m trying to train a model and am using tf.contrib.data.batch_and_drop_remainder to prepare my dataset. When I run estimator.train I get the following error: NotFoundError: Op type not registered 'BatchDatasetV2' in binary running on n-be8b2535-w-0. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) tf.contrib.resampler should be done before importing the graph, as

Google colab TPU and reading from disc while traning

不羁的心 提交于 2019-12-08 07:24:39
问题 I have 100k pics, and it doesn't fit into ram, so I need read it from disc while training. dataset = tf.data.Dataset.from_tensor_slices(in_pics) dataset = dataset.map(extract_fn) def extract_fn(x): x = tf.read_file(x) x = tf.image.decode_jpeg(x, channels=3) x = tf.image.resize_images(x, [64, 64]) return x But then I try to train, I get this error File system scheme '[local]' not implemented (file: '/content/anime-faces/black_hair/danbooru_2629248_487b383a8a6e7cc0e004383300477d66.jpg') Can I

Keras TPU. Compilation failure: Detected unsupported operations

风流意气都作罢 提交于 2019-12-07 04:41:03
问题 I try to run my keras UNet model using Google Colab TPU and I faced this problem with UpSampling2D . Any solutions or workaround? Code to run: import os import numpy as np import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import UpSampling2D model = Sequential() model.add(UpSampling2D((2, 2), input_shape=(16, 16, 1))) model.compile(optimizer=tf.train.RMSPropOptimizer(learning_rate=0.01), loss='binary_crossentropy', metrics=['acc']) TPU_WORKER

Keras TPU. Compilation failure: Detected unsupported operations

删除回忆录丶 提交于 2019-12-05 09:49:29
I try to run my keras UNet model using Google Colab TPU and I faced this problem with UpSampling2D . Any solutions or workaround? Code to run: import os import numpy as np import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import UpSampling2D model = Sequential() model.add(UpSampling2D((2, 2), input_shape=(16, 16, 1))) model.compile(optimizer=tf.train.RMSPropOptimizer(learning_rate=0.01), loss='binary_crossentropy', metrics=['acc']) TPU_WORKER = 'grpc://' + os.environ['COLAB_TPU_ADDR'] tf.logging.set_verbosity(tf.logging.INFO) model = tf.contrib

How to save a Tensorflow Checkpoint file from Google Colaboratory in when using TPU mode?

喜夏-厌秋 提交于 2019-12-04 15:29:15
When I use saver = tf.train.Saver() and save_path = saver.save(session, "checkpointsFolder/checkpoint.ckpt") I get a UnimplementedError (see above for traceback): File system scheme '[local]' not implemented error Here is the full error --------------------------------------------------------------------------- UnimplementedError Traceback (most recent call last) /usr/local/lib/python3.6/dist-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args) 1333 try: -> 1334 return fn(*args) 1335 except errors.OpError as e: /usr/local/lib/python3.6/dist-packages/tensorflow/python