尽管分配了正确的服务帐户,但仍通过Google AutoML vision Python API获得403响应

尽管分配了正确的服务帐户,但仍通过Google AutoML vision Python API获得403响应,python,google-cloud-automl,Python,Google Cloud Automl,我已经使用google cloud AutoML Vision API培训了一个模型,但是当我特别尝试通过Python包获取模型性能指标时,我一直得到403响应: PermissionDenied: 403 Permission 'automl.modelEvaluations.list' denied on resource 'projects/MY_BUCKET_ID/locations/us-central1/models/MY_MODEL_ID' (or it may not exist

我已经使用google cloud AutoML Vision API培训了一个模型,但是当我特别尝试通过Python包获取模型性能指标时,我一直得到403响应:

PermissionDenied: 403 Permission 'automl.modelEvaluations.list' denied on resource 'projects/MY_BUCKET_ID/locations/us-central1/models/MY_MODEL_ID' (or it may not exist).
我正在使用文档中展示的python代码,并且在其他操作(创建数据集、训练模型)中也没有任何未经授权的操作,因此很难理解为什么会出现这种情况。代码如下:

# Get the full path of the model.
model_full_id = client.model_path(project_id, compute_region, model_id)
print(model_full_id)

# List all the model evaluations in the model by applying filter.
response = client.list_model_evaluations(model_full_id, filter_)

谢谢你的帮助

经过几次测试,我发现了这个问题。在调用模型详细信息时,您需要使用model_id而不是model_name,而在文档中以前的API调用中,model_name是要使用的标识符

model_full_id = client.model_path(project_id, compute_region, model_id)

这解决了问题

经过几次测试,我发现了问题。在调用模型详细信息时,您需要使用model_id而不是model_name,而在文档中以前的API调用中,model_name是要使用的标识符

model_full_id = client.model_path(project_id, compute_region, model_id)
这解决了问题