Unable to access TPU from VM in GCP


wadhwashahir

try running this code

import os import tensorflow as tf from tensorflow.contrib 


import tpu from tensorflow.contrib.cluster_resolver import TPUClusterResolver

def axy_computation(a, x, y):   return a * x + y

inputs = [
    3.0,
    tf.ones([3, 3], tf.float32),
    tf.ones([3, 3], tf.float32), ]

tpu_computation = tpu.rewrite(axy_computation, inputs)

tpu_grpc_url = TPUClusterResolver(
    tpu=["sahil-wadhwa"], zone="us-central1-b").get_master()

with tf.Session(tpu_grpc_url) as sess:   
sess.run(tpu.initialize_system())   
sess.run(tf.global_variables_initializer())   
output = sess.run(tpu_computation)   
print(output)   
sess.run(tpu.shutdown_system())

But I am getting the following error,

googleapiclient.errors.HttpError: https://tpu.googleapis.com/v1alpha1/projects/nlp-research-198620/locations/us-central1-b/nodes/sahil-wadhwa?alt=json returns "permission 'tpu.nodes .get" rejected on "projects/nlp-research-198620/locations/us-central1-b/nodes/sahil-wadhwa"

Can someone tell me what to provide my VM or TPU to run smoothly?

Michael Bu

The ctpu tool automates many of these steps and is the recommended way to create TPUs and VMs.

If you wish to create the VM manually, you will need to add the cloud platform authentication scope to the VM as described here

gcloud compute instances create tpu-demo-vm \
  --machine-type=n1-standard-2 \
  --image-project=ml-images \
  --image-family=tf-1-11 \
  --scopes=cloud-platform

https://cloud.google.com/tpu/docs/custom-setup#create_resources

Related


Unable to access TPU from VM in GCP

wadhwashahir try running this code import os import tensorflow as tf from tensorflow.contrib import tpu from tensorflow.contrib.cluster_resolver import TPUClusterResolver def axy_computation(a, x, y): return a * x + y inputs = [ 3.0, tf.ones([3,

GCP: How to access cloud storage bucket from VM instance

Viacheslav Shalamov I am trying to deploy and run a docker image in a GCP VM instance. I need it to access a specific Cloud Storage Bucket (read and write). How to mount a bucket inside a virtual machine? How do I mount a bucket in a Docker container running i

GCP: How to access cloud storage bucket from VM instance

Viacheslav Shalamov I am trying to deploy and run a docker image in a GCP VM instance. I need it to access a specific Cloud Storage Bucket (read and write). How to mount a bucket inside a virtual machine? How do I mount a bucket in a Docker container running i

GCP: How to access cloud storage bucket from VM instance

Viacheslav Shalamov I am trying to deploy and run a docker image in a GCP VM instance. I need it to access a specific Cloud Storage Bucket (read and write). How to mount a bucket inside a virtual machine? How do I mount a bucket in a Docker container running i

GCP: How to access cloud storage bucket from VM instance

Viacheslav Shalamov I am trying to deploy and run a docker image in a GCP VM instance. I need it to access a specific Cloud Storage Bucket (read and write). How to mount a bucket inside a virtual machine? How do I mount a bucket in a Docker container running i

GCP: How to access cloud storage bucket from VM instance

Viacheslav Shalamov I am trying to deploy and run a docker image in a GCP VM instance. I need it to access a specific Cloud Storage Bucket (read and write). How to mount a bucket inside a virtual machine? How do I mount a bucket in a Docker container running i

GCP: How to access cloud storage bucket from VM instance

Viacheslav Shalamov I am trying to deploy and run a docker image in a GCP VM instance. I need it to access a specific Cloud Storage Bucket (read and write). How to mount a bucket inside a virtual machine? How do I mount a bucket in a Docker container running i

Unable to create new VM instance in GCP

k16 When I try to create a new VM instance from the GCP console, I suddenly get the error "Exceeded quota 'IN_USE_ADDRESSES'. Limit: 23.0" . I already have about 20 VM instances running in my account, but at the moment I can't create new VM instances neither f

Unable to stop GCP VM using Terraform

Xonan2 I try to stop the GCP VM in terraform with desired_status="TERMINATED" but I get the following error code: error: unsupported parameter In main.tf line 24, in resource "google_compute_instance" "default": 24: desired_status="TERMINATED" A parameter name

Unable to stop GCP VM instance, autostart

Larry Cai I recently took over a GCP project, created snapshots to restore in case of errors, and now I need to restore one of them. Part of this process includes stopping the currently running VM instance. Whenever I do this, the instance automatically starts

Unable to stop GCP VM using Terraform

Xonan2 I try to stop the GCP VM in terraform with desired_status="TERMINATED" but I get the following error code: error: unsupported parameter In main.tf line 24, in resource "google_compute_instance" "default": 24: desired_status="TERMINATED" A parameter name

Unable to create new VM instance in GCP

k16 When I try to create a new VM instance from the GCP console, I suddenly get the error "Exceeded quota 'IN_USE_ADDRESSES'. Limit: 23.0" . I already have about 20 VM instances running in my account, but at the moment I can't create new VM instances neither f

Unable to stop GCP VM using Terraform

Xonan2 I try to stop the GCP VM in terraform with desired_status="TERMINATED" but I get the following error code: error: unsupported parameter In main.tf line 24, in resource "google_compute_instance" "default": 24: desired_status="TERMINATED" A parameter name

Unable to stop GCP VM using Terraform

Xonan2 I try to stop the GCP VM in terraform with desired_status="TERMINATED" but I get the following error code: error: unsupported parameter In main.tf line 24, in resource "google_compute_instance" "default": 24: desired_status="TERMINATED" A parameter name

Unable to stop GCP VM using Terraform

Xonan2 I try to stop the GCP VM in terraform with desired_status="TERMINATED" but I get the following error code: error: unsupported parameter In main.tf line 24, in resource "google_compute_instance" "default": 24: desired_status="TERMINATED" A parameter name

Unable to access Elasticsearch 2.0 in Vagrant VM from host OS

Sloan Ahrens I'm trying to start Elasticsearch 2.0 up and running in a Vagrant VM. The method I was using in 1.7 doesn't work anymore, so I'm trying to update my method. I can install ES 2.0 in the VM and it seems to work fine inside the VM, but I can't access

Unable to access Elasticsearch 2.0 in Vagrant VM from host OS

Sloan Ahrens I'm trying to start Elasticsearch 2.0 up and running in a Vagrant VM. The method I was using in 1.7 doesn't work anymore, so I'm trying to update my method. I can install ES 2.0 in the VM and it seems to work fine inside the VM, but I can't access

Unable to access Jupyter Labs from Google Deep Learning VM

Nail Aribzhanov After installing the Google Deep Learning VM, I am trying to open Jupyter Lab. I run the following code in my browser's SSH terminal: export PROJECT_ID="name" export ZONE="us-west1-b" export INSTANCE_NAME="tensorflow-1-vm" gcloud compute ssh --

Unable to access Jupyter Labs from Google Deep Learning VM

Nail Aribzhanov After installing the Google Deep Learning VM, I am trying to open Jupyter Lab. I run the following code in my browser's SSH terminal: export PROJECT_ID="name" export ZONE="us-west1-b" export INSTANCE_NAME="tensorflow-1-vm" gcloud compute ssh --

Unable to access Elasticsearch 2.0 in Vagrant VM from host OS

Sloan Ahrens I'm trying to start Elasticsearch 2.0 up and running in a Vagrant VM. The method I was using in 1.7 doesn't work anymore, so I'm trying to update my method. I can install ES 2.0 in the VM and it seems to work fine inside the VM, but I can't access

Unable to access Jupyter Labs from Google Deep Learning VM

Nail Aribzhanov After installing the Google Deep Learning VM, I am trying to open Jupyter Lab. I run the following code in my browser's SSH terminal: export PROJECT_ID="name" export ZONE="us-west1-b" export INSTANCE_NAME="tensorflow-1-vm" gcloud compute ssh --

Unable to access Jupyter Labs from Google Deep Learning VM

Nail Aribzhanov After installing the Google Deep Learning VM, I am trying to open Jupyter Lab. I run the following code in my browser's SSH terminal: export PROJECT_ID="name" export ZONE="us-west1-b" export INSTANCE_NAME="tensorflow-1-vm" gcloud compute ssh --