GithubHelp home page GithubHelp logo

serverless-mxnet-server's Introduction

Serverless-MXNet-Server

This is a work in progress. Check out the outstanding problems section below.

AWS has developed MXNet, a deep learning framework. Recently, they released a model server for MXNet, which makes it easy to set up an endpoint for serving your models.

This is a project to deploy the MXNet server in a Serverless application. Autoscaling, low-management model serving FTW ⚡️.

Usage

  1. Install the Serverless Framework:

    $ npm install -g serverless
  2. Install this repository as a template:

    $ sls install --url https://github.com/alexdebrie/serverless-mxnet-server && cd serverless-mxnet-server
    $ npm install
  3. Deploy!

    $ sls deploy
  4. Call your endpoint!

    # Set your BASE_URL with the endpoint given with sls deploy
    $ export BASE_URL="https://58kx6wsxej.execute-api.us-east-1.amazonaws.com/dev"
    $ curl -X POST ${BASE_URL}/squeezenet/predict -F "[email protected]"
    

Outstanding problems

I'm having trouble getting the image data through API Gateway in the format expected by the MXNet server.

To get it working locally:

  1. Create a virtual environment and install all required packages:

    $ virtualenv venv --python=python3 && source venv/bin/activate
    $ pip install -r requirements.txt
  2. Start your app locally:

    $ sls wsgi serve
  3. Make a request against it:

    curl -X POST http://127.0.0.1:5000/squeezenet/predict -F "[email protected]"
    {
      "prediction": [
        [
          {
            "class": "n02124075 Egyptian cat",
            "probability": 0.9408263564109802
          },
          {
            "class": "n02127052 lynx, catamount",
            "probability": 0.05596580728888512
          },
          {
            "class": "n02123045 tabby, tabby cat",
            "probability": 0.0025502473581582308
          },
          {
            "class": "n02123159 tiger cat",
            "probability": 0.00034319929545745254
          },
          {
            "class": "n02123394 Persian cat",
            "probability": 0.000268968433374539
          }
        ]
      ]
    }

serverless-mxnet-server's People

Contributors

alexdebrie avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.