BigQueryML中TensorFlow模型的ML.PREDICT的多列输入



我们在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
))

有人这样做过吗?

这与这个仍然悬而未决的问题类似:BigQuery ML 中TensorFlow模型的ML.PREDICT的多列输入

谢谢大家。

将模型加载到BigQuery ML中后,单击BigQuery UI中的模型并切换到"Schema"选项卡。这应该会告诉你模型想要什么列。

或者,在模型上运行程序saved_model_cli(这是tensorflow附带的python程序(,查看支持的签名是什么

saved_model_cli show --dir $export_path --all

最新更新