我正在尝试在 Google 的 AI 平台上运行自定义预测例程,但是当我将 spaCy 作为必需包包含在我的以下内容时总是会出错setup.py
:
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 Platform 就能够创建版本,因此看起来不正确的函数名称或包名称不是问题所在。显然,我的模型依赖于 spaCy,因此不能选择将其排除在外。
有谁知道如何解决这一问题?