尝试运行此代码
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())
但是我收到以下错误,
googleapiclient.errors.HttpError:https://tpu.googleapis.com/v1alpha1/projects/nlp-research-198620/locations/us-central1-b/nodes/sahil-wadhwa?alt=json 返回“权限'tpu.nodes .get' 在 'projects/nlp-research-198620/locations/us-central1-b/nodes/sahil-wadhwa' 上被拒绝
有人能告诉我需要什么权限来提供我的 VM 或 TPU 才能顺利运行吗?