简体   繁体   English

将我的Python机器学习模型部署为Web服务

[英]To Deploy my Python machine learning model as web service

I have developed a Machine learning model in anaconda prompt using Python3 so to deploy it and to run it anywhere dynamically on GitHub or as a webservice what is the way? 我已经在Python的anaconda提示符下开发了一个机器学习模型,以便部署它并在GitHub上或作为Web服务在任何地方动态运行它,这是怎么回事?

I have already used Pickle command but it didn't work for me. 我已经使用了Pickle命令,但对我不起作用。

import pickle 
file_name = "cancerdetection.ipynb"

It didn't deploy my model as webservice. 它没有将我的模型部署为Web服务。

You can try using flask. 您可以尝试使用烧瓶。 It uses python and deploys as a web application. 它使用python并将其部署为Web应用程序。 Here's some sample code you can try. 这是您可以尝试的一些示例代码。

from flask import Flask, render_template, request
app = Flask(__name__, static_url_path='/static')

@app.route('/')
def upload_file():    
    return "hello world"
if __name__ == '__main__':
    app.run(host="0.0.0.0")

By setting 通过设置

host="0.0.0.0" 主机=“ 0.0.0.0”

you're deploying your application on the net by using your local machine as a server. 您正在使用本地计算机作为服务器在网上部署应用程序。

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

相关问题 如何在 django web 应用程序中部署机器学习模型? - How to deploy a machine learning model in a django web app? 如何将我的机器学习 model 从 python 移植到 java web 应用程序? - how do i port my machine learning model from python to java web app? 部署端点 model Azure 机器学习失败 - Failed deploy endpoint model Azure Machine Learning 如何使用从 Python 中的 pickle 文件加载的模型部署机器学习模型? - How to deploy machine Learning model with model loaded from pickle file in Python? Python 机器学习 Web Api - Python Machine learning Web Api Azure 机器学习工作室:无法以 rpy2 作为依赖项部署 model - Azure Machine Learning Studio: cannot deploy model with rpy2 as a dependency 我们如何使用 Flask 部署机器学习 Model? - How can we deploy a Machine Learning Model using Flask? 如何使用 Flask、GitHub 和 Heroku 将我的 Tensorflow 深度学习模型部署为 Web 应用程序 - How can I deploy my Tensorflow Deep Learning model as a web application using Flask, GitHub and Heroku 如何部署机器学习模型以使用多个特征数据进行预测 - How to deploy machine learning model to predict with multiple feature data Python 中的 OCR 机器学习 - 使用 keras 训练模型 - OCR Machine Learning in Python -Training model with keras
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM