在Google AI平台上基于SpaCy的自定义预测

时间:2020-07-31 16:30:10

标签: google-cloud-platform spacy google-ai-platform

我正在尝试在Google的AI平台上运行自定义预测例程,但是当我将setup.py中包含spaCy作为必需软件包时,总是会出错:

gcloud beta ai-platform versions create v1 --model MODEL_NAME --python-version=3.7 --runtime-version=1.15 --package-uris=gs://PATH_TO_PACKAGE --machine-type=mls1-c4-m2 --origin=gs://PATH_TO_MODEL --prediction-class=basic_predictor.BasicPredictor
Using endpoint [https://ml.googleapis.com/]
Creating version (this might take a few minutes)......failed.
ERROR: (gcloud.beta.ai-platform.versions.create) Create Version failed. Bad model detected with error:  "There was a problem processing the user code: basic_predictor.BasicPredictor cannot be found. Please make sure (1) prediction_class is the fully qualified function name, and (2) it uses the correct package name as provided by the package_uris: ['gs://PATH_TO_PACKAGE'] (Error code: 4)"

一旦删除spaCy作为依赖项,AI平台就可以创建该版本,因此看来函数名称或程序包名称不正确不会成为问题。显然,我的模型依赖于spaCy,因此不要选择它。

有人知道如何解决此问题吗?

1 个答案:

答案 0 :(得分:0)

这似乎是有关如何在AI Platform预测节点上安装依赖项的问题。我复制了该问题,并得到了相同的错误,我也尝试将该库打包为tar.gz文件,但是以相同的方式失败了。

我继续在GCP IssueTracker中报告了此问题,以便AI平台团队可以对其进行调查,可以订阅并在有任何更新时接收通知。