python - 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 并从头开始重做培训。
我求助于将我的模型暴露在烧瓶应用程序后面并将其部署到应用程序引擎,这运行良好,但对于两个模型来说可能有点矫枉过正。工作正常。
解决方案
推荐阅读
- bash - 在 bash 中重复使用标准输入
- python - PyCharm中关键词的不同颜色文本?
- c++ - 如何在 C++ 中删除动态数组的列
- swift - 如何在 swift 中创建自己的代码完成描述
- flutter - Flutter:当倒数计时器达到 0 时执行动作
- sqlite - MongoDB ObjectID 作为主键 SQlite 数据库
- c# - 使用 EF Core 3.1 加载相关数据
- intellij-idea - 如何使用 Intellij 在另一个项目中使用一个项目中的方法?
- php - 我如何在 Laravel 5 中的 guard()->attempt 方法中得到特定的错误
- javascript - 排序对象的对象