首页 > 解决方案 > GCP AI 平台自定义预测例程无法使用管道加载模型,错误:92

问题描述

我目前正在尝试使用https://cloud.google.com/ai-platform/prediction/docs/custom-prediction-routine-scikit-learn作为指导将模型部署到 GCP AI 平台。运行时gcloud beta ai platform versions create出现以下错误,截至 2020 年 2 月 20 日没有命中:

Creating version (this might take a few minutes)......failed.
ERROR: (gcloud.beta.ai-platform.versions.create) Create Version failed. Bad model detected with 
error:  "Failed to load model: Unexpected error when loading the model: 92 (Error code: 0)"

我的模型是一个 Sci-kit 学习多项式朴素贝叶斯分类器,它在管道中使用两个 tf/idf 矢量化器(word 和 char 级别)。我使用 joblib 版本 0.13.0 存储整个管道,它与 GCP 支持的版本匹配(链接:https ://cloud.google.com/ai-platform/prediction/docs/runtime-version-list )。

按照教程,我已经 tar.gz'ed 应该提供此服务的代码并将模型和腌制预处理器存储在存储桶中。按照其他地方的建议,我还将预处理器与 joblib 一起存储,遗憾的是它也不起作用。

我已经joblib.load很好地编辑了模型并在 0.13.0 中提供了预测,所以我要拔掉头发了。

更新:我已经检查并重做了几次酸洗/作业库,甚至设置了一个新的 virtualenv 以匹配 1.15 并从头开始重做培训。

我求助于将我的模型暴露在烧瓶应用程序后面并将其部署到应用程序引擎,这运行良好,但对于两个模型来说可能有点矫枉过正。工作正常。

标签: pythongoogle-cloud-platformjoblibgcp-ai-platform-training

解决方案


推荐阅读