关于Tensorflow扩展BigQuery作为ExampleGen的问题

问题描述 投票:0回答:1

我正在学习使用TensorFlow扩展构建一个机器学习管道,我按照教程进行了操作,现在我喜欢构建自己的管道。当我直接从BigQuery摄取数据时,我得到了错误。请给予建议,并提前表示感谢

CODE:

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)

ERROR:

RuntimeError: Missing executing project information. Please use the --project command line option to specify it.
tensorflow google-cloud-platform google-bigquery tensorflow2.0 tfx
1个回答
0
投票

我不知道你是否已经解决了这个问题,但是要使用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"])

1
投票

由于bigquery客户端init的params不支持,即使在我添加了Google Applicaton Credential之后,我已经解决了使用CsvExampleGen的问题。

© www.soinside.com 2019 - 2024. All rights reserved.