【问题标题】:Multi-column input to ML.PREDICT for a TensorFlow model in BigQueryMLML.PREDICT 的多列输入,用于 BigQueryML 中的 TensorFlow 模型
【发布时间】:2020-07-03 06:46:45
【问题描述】:

我们已经在 Google Cloud AutoML(我们非常喜欢的一个工具)中训练了一个模型并成功将其导出到 GCS,然后使用以下命令在 BigQuery 中创建了模型:

create or replace model my_dataset.my_bq_ml_model
options(model_type='tensorflow',
 model_path='my gcs path to exported tensorflow model'))

但是,当我们使用 BigQueryML 尝试使用模型运行一些预测时,我们不确定如何将模型使用的多个特征格式化为导出的 Tensorflow 模型在 BigQuery 中接受的单个“输入”字符串。

select  *
from    ml.predict(model my_project.my_dataset.my_bq_ml_model,
(
 select 'How do we format this?'  as inputs
 from my_rows_to_predict
))

有人做过吗?

这类似于这个问题,它仍然是开放的: Multi-column input to ML.PREDICT for a TensorFlow model in BigQuery ML

谢谢大家。

【问题讨论】:

    标签: tensorflow machine-learning google-cloud-platform google-bigquery google-cloud-automl


    【解决方案1】:

    将模型加载到 BigQuery ML 后,点击 BigQuery 用户界面中的模型并切换到“架构”标签。这应该会告诉您模型需要哪些列。

    或者,在模型上运行程序 saved_model_cli(它是一个 tensorflow 自带的 python 程序),看看支持的签名是什么

    saved_model_cli show --dir $export_path --all
    

    【讨论】:

    • 嗨 Lak 谢谢你的上述。我们按照上面的步骤操作,她就是输出。 pastebin.com/HCbpZT20 但是,我们不确定如何将其转换为 BigQueryML 中模型的输入字符串的签名。可以给点建议吗?
    • 不幸的是,saved_model_cli 不是很有帮助——它不会告诉你输入的模式,只是它是一个字符串 ... inputs['inputs'] tensor_info: dtype: DT_STRING 形状:(-1)。这没有任何帮助。也许尝试将数据放入 JSON 格式?
    猜你喜欢
    • 2020-06-19
    • 2021-04-18
    • 2022-01-23
    • 2021-12-26
    • 1970-01-01
    • 2021-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多