通过 gcloud dataproc 读取张量文件

read tensor file via gcloud dataproc

你好,我应该如何修改我的代码才能正确读取数据集 2?

 %%writefile read_rdd.py 
def read_RDD(argv):
  parser = argparse.ArgumentParser() # get a parser object
  parser.add_argument('--test_set', metavar='test_set', type =ParallelMapDataset) 
  args = parser.parse_args(argv) # read the value
  args.test_set.take(3) 
  for i in args.test_set:
    print(i)               

并执行

test_set = dataset2     #dataset2 cannot be inserted
!gcloud dataproc jobs submit pyspark --cluster $CLUSTER --region $REGION \
    ./read_rdd.py \
    --  --test_set $test_set 

                                                                                                                                  aditional information                                                                                             

类型(数据集2)=tensorflow.python.data.ops.dataset_ops

我尝试将 type =ParallelMapDataset 更改为 type=argparse.FileType('r') 但它也不起作用

目前我无法提交工作 我正在安装

/bin/bash: -c: 第 0 行:意外标记附近的语法错误 (' /bin/bash: -c: line 0:gcloud dataproc 作业提交 pyspark --cluster bigdatapart2-cluster --region us-central1 ./read_rdd.py -- --test_set '

请注意,您通过 gcloud dataproc jobs submit pyspark 传递的参数已转换为标准命令行。尝试用引号将参数括起来:

test_set = dataset2     #dataset2 cannot be inserted
!gcloud dataproc jobs submit pyspark --cluster $CLUSTER --region $REGION \
    ./read_rdd.py \
    --  --test_set "$test_set"