Google cloud ml KeyError:u";FALSE[在运行时提取标签ID';]”;

Google cloud ml KeyError:u";FALSE[在运行时提取标签ID';]”;,google-cloud-ml,apache-beam,Google Cloud Ml,Apache Beam,我正在cloudml示例中使用花卉教程代码,试图在一组餐厅照片上实现多标签分类 我有dict.txt和相应更新的输入,下面是示例行 dict.txt eval_set.csv 预处理作业开始正常运行,然后我看到这个特定错误不断出现,直到作业失败 python trainer/preprocess.py \ --input_dict "$DICT_FILE" \ --input_path "gs://yelp_restaurant_photo_classification/label

我正在cloudml示例中使用花卉教程代码,试图在一组餐厅照片上实现多标签分类

我有dict.txt和相应更新的输入,下面是示例行


dict.txt
eval_set.csv
预处理作业开始正常运行,然后我看到这个特定错误不断出现,直到作业失败

python trainer/preprocess.py \
  --input_dict "$DICT_FILE" \
  --input_path "gs://yelp_restaurant_photo_classification/labels/eval_set.csv" \
  --output_path "${GCS_PATH}/preproc/eval" \
  --cloud


作业日志-KeyError:u“FALSE[在运行“提取标签ID”时]”
作业日志-工作流失败
您的输入CSV文件中可能有一行标签为“FALSE”,但“dict.txt”中没有“FALSE”

你能在你的帖子中提供两个额外的细节吗?您运行的环境是什么:云shell、datalab docker、本地机器等?另外,您是否确定.csv中的所有标签都存在于dict.xt?1中。环境是GoogleCloudShell,flower示例能够成功地端到端运行。2.不,我注意到我没有在dict.txt中包含eval_集合中的所有标签,因此我通过在dict.txt中添加丢失的标签来重新运行,以查看工作流是否可以完成。后续问题来自preprocess.py中的注释,我的理解是带有标签的图像(不在dict.txt中)将被跳过,而不是期望出现错误消息?是的,你是对的;评论是谎言。我会更新代码谢谢你提出来!你是对的,我没有重新检查csv文件,这是我的错,csv中存在“FALSE”,因为培训中的一些照片没有分配任何类别。但是,根据“处理CSV文件时:-跳过输入目录中不存在的所有标签”。如果FALSE被视为输入目录中未显示的标签,则应跳过该行。我通过在输入命令中添加“FALSE”来重新运行作业,以查看“FALSE”错误是否是作业失败的原因。
...
gs://yelp_restaurant_photo_classification/train_photos/312753.jpg,good_for_dinner,takes_reservations,has_alcohol,has_table_service,good_for_kids
gs://yelp_restaurant_photo_classification/train_photos/342651.jpg,good_for_lunch,good_for_dinner,outdoor_seating,good_for_kids
gs://yelp_restaurant_photo_classification/train_photos/217079.jpg,takes_reservations,has_table_service
...
python trainer/preprocess.py \
  --input_dict "$DICT_FILE" \
  --input_path "gs://yelp_restaurant_photo_classification/labels/eval_set.csv" \
  --output_path "${GCS_PATH}/preproc/eval" \
  --cloud
(d8285fa55cb6ab07): Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/dataflow_worker/batchworker.py", line 514, in do_work
    work_executor.execute()
  File "dataflow_worker/executor.py", line 894, in dataflow_worker.executor.MapTaskExecutor.execute (dataflow_worker/executor.c:24204)
    op.start()
  File "dataflow_worker/executor.py", line 197, in dataflow_worker.executor.ReadOperation.start (dataflow_worker/executor.c:7039)
    def start(self):
  File "dataflow_worker/executor.py", line 202, in dataflow_worker.executor.ReadOperation.start (dataflow_worker/executor.c:6946)
    with self.spec.source.reader() as reader:
  File "dataflow_worker/executor.py", line 212, in dataflow_worker.executor.ReadOperation.start (dataflow_worker/executor.c:6891)
    self.output(windowed_value)
  File "dataflow_worker/executor.py", line 142, in dataflow_worker.executor.Operation.output (dataflow_worker/executor.c:5249)
    cython.cast(Receiver, self.receivers[output_index]).receive(windowed_value)
  File "dataflow_worker/executor.py", line 89, in dataflow_worker.executor.ConsumerSet.receive (dataflow_worker/executor.c:3487)
    cython.cast(Operation, consumer).process(windowed_value)
  File "dataflow_worker/executor.py", line 500, in dataflow_worker.executor.DoOperation.process (dataflow_worker/executor.c:14239)
    self.dofn_receiver.receive(o)
  File "apache_beam/runners/common.py", line 134, in apache_beam.runners.common.DoFnRunner.receive (apache_beam/runners/common.c:4172)
    self.process(windowed_value)
  File "apache_beam/runners/common.py", line 168, in apache_beam.runners.common.DoFnRunner.process (apache_beam/runners/common.c:5282)
    self.reraise_augmented(exn)
  File "apache_beam/runners/common.py", line 181, in apache_beam.runners.common.DoFnRunner.reraise_augmented (apache_beam/runners/common.c:5665)
    raise
  File "apache_beam/runners/common.py", line 166, in apache_beam.runners.common.DoFnRunner.process (apache_beam/runners/common.c:5218)
    self._process_outputs(element, self.dofn_process(self.context))
  File "apache_beam/runners/common.py", line 222, in apache_beam.runners.common.DoFnRunner._process_outputs (apache_beam/runners/common.c:6400)
    self.main_receivers.receive(windowed_value)
  File "dataflow_worker/executor.py", line 89, in dataflow_worker.executor.ConsumerSet.receive (dataflow_worker/executor.c:3487)
    cython.cast(Operation, consumer).process(windowed_value)
  File "dataflow_worker/executor.py", line 500, in dataflow_worker.executor.DoOperation.process (dataflow_worker/executor.c:14239)
    self.dofn_receiver.receive(o)
  File "apache_beam/runners/common.py", line 134, in apache_beam.runners.common.DoFnRunner.receive (apache_beam/runners/common.c:4172)
    self.process(windowed_value)
  File "apache_beam/runners/common.py", line 168, in apache_beam.runners.common.DoFnRunner.process (apache_beam/runners/common.c:5282)
    self.reraise_augmented(exn)
  File "apache_beam/runners/common.py", line 179, in apache_beam.runners.common.DoFnRunner.reraise_augmented (apache_beam/runners/common.c:5646)
    raise type(exn), args, sys.exc_info()[2]
  File "apache_beam/runners/common.py", line 166, in apache_beam.runners.common.DoFnRunner.process (apache_beam/runners/common.c:5218)
    self._process_outputs(element, self.dofn_process(self.context))
  File "apache_beam/runners/common.py", line 191, in apache_beam.runners.common.DoFnRunner._process_outputs (apache_beam/runners/common.c:5838)
    for result in results:
  File "trainer/preprocess.py", line 130, in process
KeyError: u"FALSE [while running 'Extract label ids']"
(f3c7c09c0b6a453c): Workflow failed. Causes: (688819c5d32d79c8): S06:Read input+Parse input+Extract label ids+Read and convert to JPEG+Embed and make TFExample+Save to disk/Write to gs:__yelp_restaurant_photo_classification_yelp_restaurant_photo_classification_preproc_eval/Write/WriteImpl/write_bundles+Save to disk/Write to gs:__yelp_restaurant_photo_classification_yelp_restaurant_photo_classification_preproc_eval/Write/WriteImpl/pair+Save to disk/Write to gs:__yelp_restaurant_photo_classification_yelp_restaurant_photo_classification_preproc_eval/Write/WriteImpl/WindowInto+Save to disk/Write to gs:__yelp_restaurant_photo_classification_yelp_restaurant_photo_classification_preproc_eval/Write/WriteImpl/GroupByKey/Reify+Save to disk/Write to gs:__yelp_restaurant_photo_classification_yelp_restaurant_photo_classification_preproc_eval/Write/WriteImpl/GroupByKey/Write failed.