我试图在谷歌的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,所以不能省略它。
有人知道怎么解决这个问题吗?
发布于 2020-08-03 22:44:48
这似乎是一个如何在AI平台预测节点上安装依赖项的问题。我复制了这个问题,得到了相同的错误,我还试图将库打包为tar.gz文件,但以同样的方式失败了。
我继续在GCP IssueTracker上报告了这个问题,这样AI平台团队就可以调查它,你可以订阅它,在有更新的时候收到通知。
https://stackoverflow.com/questions/63195708
复制相似问题