简体   繁体   English

如何在EC2上部署机器学习模型并连接到没有Lambda的API网关?

[英]How to deploy a machine learning model on EC2 and connect to API Gateway without Lambda?

I have trained a classifier using scikit.learn. 我已经使用scikit.learn训练了一个分类器。 I want to set up an API Gateway, so a user can submit the data using this API. 我想设置一个API网关,以便用户可以使用此API提交数据。 After data run through the trained model, return the result using the API as well. 在数据经过训练后的模型运行之后,还使用API​​返回结果。

Since my model requires spacy.io's big trained model as the backend, I CANNOT use Lambda due to Lambda's limitation on file size (512 MB). 由于我的模型需要spacy.io训练有素的大型模型作为后端,因此由于Lambda对文件大小(512 MB)的限制,我无法使用Lambda。 But all I Googled is related to Lambda. 但是我在Google上搜索的所有内容都与Lambda有关。

I am thinking, in my EC2 instance, I setup a Flask or Django app to receive the data from API Gateway and then run the model, return the result back to API Gateway. 我在想,在我的EC2实例中,我设置了Flask或Django应用程序以从API Gateway接收数据,然后运行模型,将结果返回给API Gateway。

But I don't know how to do it, could any one point out some resources? 但是我不知道该怎么做,有人可以指出一些资源吗?

Or is there any better solution out there? 还是那里有更好的解决方案?

It sounds like you've only discovered documentation for the Lambda integration method. 听起来您只发现了Lambda集成方法的文档。 You need to look at either the HTTP or HTTP_PROXY integration methods. 您需要查看HTTP或HTTP_PROXY集成方法。 I would start by reading this page in the documentation, and then proceed to this page . 我将从阅读文档中的此页面开始,然后继续进行至此页面

If you also want to prevent anything but API gateway from directly accessing your back-end system, then you will also need to setup client-side SSL certificate verification on your back-end. 如果您还希望防止API网关以外的任何其他因素直接访问您的后端系统,那么您还需要在后端上设置客户端SSL证书验证

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过 AWS Lambda 使用 pysftp 连接 EC2,无需 .pem 文件或替代 to.pem 文件 - How to connect EC2 using pysftp via AWS Lambda without .pem file or alternate to .pem file 如何部署机器学习模型以使用多个特征数据进行预测 - How to deploy machine learning model to predict with multiple feature data 如何在 django web 应用程序中部署机器学习模型? - How to deploy a machine learning model in a django web app? 我们如何使用 Flask 部署机器学习 Model? - How can we deploy a Machine Learning Model using Flask? 通过 API Gateway 在 EC2 上运行函数 - Running a function on EC2 through API Gateway 部署端点 model Azure 机器学习失败 - Failed deploy endpoint model Azure Machine Learning 如何在 AWS EC2 上连接 Google Sheet API - How to connect Google sheet API on AWS EC2 如何使用 AWS Lambda 函数将文件从 AWS S3 存储桶复制到 EC2 linux 机器 - How to copy files from AWS S3 bucket to EC2 linux machine using AWS Lambda Functions 如何使用 Python REST API 执行 R 机器学习模型? - How to Execute R Machine Learning Model using Python REST API? 如何使用从 Python 中的 pickle 文件加载的模型部署机器学习模型? - How to deploy machine Learning model with model loaded from pickle file in Python?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM