vertexai's class automltabulartrainingjob do do not d识别文档中列出的参数

发布于 2025-02-01 08:39:32 字数 2636 浏览 4 评论 0原文

我正在尝试使用vertexai类automltabulartrainingjob创建一个预测模型,并且我在文档

首先,参数column_specs是文档中的字典,而参数export_evaLET_DATA_ITEMS是一个bool。

我在下面创建了功能,然后将其称为循环中。

def create_training_pipeline_tabular_regression_sample(
display_name:str,
dataset_id:int,
column_specs:dict,
target_column:str = None,
optimization_prediction_type:str = 'regression',
optimization_objective:str = 'minimize-rmse',
model_display_name:str = None,
budget_milli_node_hours:int = 1000,
disable_early_stopping:bool = False,
export_evaluated_data:bool = True,
sync:bool = True,
**kwargs
):

tabular_regression_job = aiplatform.AutoMLTabularTrainingJob(
    display_name=display_name,
    column_specs=column_specs,
    optimization_prediction_type=optimization_prediction_type,
    optimization_objective=optimization_objective
)

my_tabular_dataset = aiplatform.TabularDataset(dataset_id)

model = tabular_regression_job.run(
    dataset=my_tabular_dataset,
    target_column=target_column,
    budget_milli_node_hours=budget_milli_node_hours,
    model_display_name=model_display_name,
    disable_early_stopping=disable_early_stopping,
    export_evaluated_data_items=True,
    sync=sync,
    **kwargs
)

model.wait()

print(model.display_name)
print(model.resource_name)
print(model.uri)
return model

错误是类不接受这些参数。错误消息:

    ---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/tmp/ipykernel_118/330955058.py in <module>
     60                     optimization_objective=optimization,
     61                     budget_milli_node_hours= BUDGET_MILLI_NODE_HOURS,
---> 62                     export_evaluated_data_items_bigquery_destination_uri=export_evaluated_data_items_bigquery_destination_uri
     63                 )
     64 

/tmp/ipykernel_118/2971171495.py in create_training_pipeline_tabular_regression_sample(display_name, dataset_id, target_column, optimization_prediction_type, optimization_objective, model_display_name, budget_milli_node_hours, disable_early_stopping, export_evaluated_data, sync, **kwargs)
     31         export_evaluated_data_items=True,
     32         sync=sync,
---> 33         **kwargs
     34     )
     35 

TypeError: run() got an unexpected keyword argument 'export_evaluated_data_items'

有人知道文档是否已更新?在页面的页脚中,更新日期是最新的,但是这些错误使我有疑问。文档中还有其他信息与API的使用不匹配。

I'm trying to create a prediction model using the VertexAI class AutoMLtabularTrainingJob, and I'm having problems with two parameters listed in the documentation.

First, the parameter column_specs is a dictionary in the documentation, and the parameter export_evaluated_data_items is a bool.

I created the function below, and I called it inside a loop.

def create_training_pipeline_tabular_regression_sample(
display_name:str,
dataset_id:int,
column_specs:dict,
target_column:str = None,
optimization_prediction_type:str = 'regression',
optimization_objective:str = 'minimize-rmse',
model_display_name:str = None,
budget_milli_node_hours:int = 1000,
disable_early_stopping:bool = False,
export_evaluated_data:bool = True,
sync:bool = True,
**kwargs
):

tabular_regression_job = aiplatform.AutoMLTabularTrainingJob(
    display_name=display_name,
    column_specs=column_specs,
    optimization_prediction_type=optimization_prediction_type,
    optimization_objective=optimization_objective
)

my_tabular_dataset = aiplatform.TabularDataset(dataset_id)

model = tabular_regression_job.run(
    dataset=my_tabular_dataset,
    target_column=target_column,
    budget_milli_node_hours=budget_milli_node_hours,
    model_display_name=model_display_name,
    disable_early_stopping=disable_early_stopping,
    export_evaluated_data_items=True,
    sync=sync,
    **kwargs
)

model.wait()

print(model.display_name)
print(model.resource_name)
print(model.uri)
return model

The error is that the class is not accepting these parameters. The error message:

    ---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/tmp/ipykernel_118/330955058.py in <module>
     60                     optimization_objective=optimization,
     61                     budget_milli_node_hours= BUDGET_MILLI_NODE_HOURS,
---> 62                     export_evaluated_data_items_bigquery_destination_uri=export_evaluated_data_items_bigquery_destination_uri
     63                 )
     64 

/tmp/ipykernel_118/2971171495.py in create_training_pipeline_tabular_regression_sample(display_name, dataset_id, target_column, optimization_prediction_type, optimization_objective, model_display_name, budget_milli_node_hours, disable_early_stopping, export_evaluated_data, sync, **kwargs)
     31         export_evaluated_data_items=True,
     32         sync=sync,
---> 33         **kwargs
     34     )
     35 

TypeError: run() got an unexpected keyword argument 'export_evaluated_data_items'

Does anyone know if the documentation is updated? In the page's footer the update date is recent, but these errors make me have doubts. And there's other information in the documentation that does not match with the API's use.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月依秋水 2025-02-08 08:39:32

当我降级到Google-Cloud-Aiplatform版本0.7.1时,我能够重现您的错误。要解决此问题,您必须使用以下命令将版本更新为最新的 Google-cloud-aiplatform 软件包。

pip install google-cloud-aiplatform --upgrade

现在,您将拥有 google-cloud-aiplatform 版本1.13.1

升级到最新版本后,您现在可以继续完成培训。

I was able to reproduce your error when I downgraded to google-cloud-aiplatform version 0.7.1. To resolve this, you must update your version to the latest google-cloud-aiplatform package by using the below command.

pip install google-cloud-aiplatform --upgrade

You will now have google-cloud-aiplatform version 1.13.1.

enter image description here

Once upgraded to the latest version, you can now proceed and finish your training.
enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文