【问题标题】:Issue on Tensorflow Extension BigQuery as ExampleGen关于 Tensorflow 扩展 BigQuery 作为 ExampleGen 的问题
【发布时间】:2020-05-06 02:34:27
【问题描述】:

我正在学习使用 TensorFlow 扩展构建机器学习管道,我按照教程进行操作,现在我想构建自己的。直接从 BigQuery 提取数据时出现错误。请提前告知和感谢!

代码:

from tfx.components.example_gen.big_query_example_gen.component import BigQueryExampleGen

query = """
    SELECT * FROM `<project_id>.<database>.<table_name>`
"""
example_gen = BigQueryExampleGen(query=query)

错误:

RuntimeError: Missing executing project information. Please use the --project command line option to specify it.

【问题讨论】:

  • 你检查this page了吗?
  • 感谢您指向该页面。我是 TFX ApacheBeam 的新手,假设 GCP 中的 Jupyter Notebook 中的代码将用于 Google AI Pipelines / Kubeflow,如何在 notebook 中添加 --project 和其他参数?
  • 我不确定,但您应该将此信息用于问题。

标签: tensorflow google-cloud-platform google-bigquery tensorflow2.0 tfx


【解决方案1】:

由于即使在我添加了 Google Applicaton Credential 之后也不支持 bigquery 客户端初始化的参数,所以我已经尝试使用 CsvExampleGen。

【讨论】:

    【解决方案2】:

    我不确定你是否已经解决了,但要使用 BigQuery 作为输入,你必须像这样设置 --project-id 标志:

    example_gen = components.BigQueryExampleGen(query='SELECT * except(day) FROM `gofind-datalake.data.temp_dist` where rand() < 2800/30713393 limit 3000')
    context.run(example_gen, beam_pipeline_args=["--project=gofind-datalake"])
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-20
      • 2011-03-10
      相关资源
      最近更新 更多