Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kelner: Serve Your Models

Kelner: Serve Your Models

Introduction to Kelner model serving.
Japanese version.

Leszek Rybicki

May 29, 2018
Tweet

More Decks by Leszek Rybicki

Other Decks in Programming

Transcript

  1. Who is this? • Leszek Rybicki リビツキ レシェック github: @lunardog •

    2016からCookpadで画像解析 • 理化学研究所のラボで 務めていたことある
  2. Your model is too big for mobile deployment, so you’ll

    have to deploy it on the server side. Hook it up to our existing rails architecture and give me an API endpoint I can call with JSON requests. I’ll be sending you a couple thousand requests per second, so make sure the latency is below 150ms. Ask @in c if you get stuck. @ap c
  3. @ap c said you’re using Python. Well then, you have

    to make a django or flask app and run it on nginx via wsgi. Make sure you have the right versions of cuda and cudnn in your docker environment. Provision a P2 instance on EC2 on and put your files in S3 with the right ACLs. You may need a load balancer so let me know if you need help calibrating the field polarity of the auxiliary neutron flow capacitors... @in c
  4. pi -in l le do r-re C I se r

    H P po / ge en n J O sa m e s in s/o t s
  5. > pip install kelner > kelnerd --load-model model.h5 Using TensorFlow

    backend. Loading a Keras model from model.h5 Loaded. Starting server... Listening on 0.0.0.0:61453 Tha ’s i !
  6. > curl --data-binary "@dog.jpg" localhost:61453 -X POST -H"Content-Type: image/jpeg" (JSON

    array of floats) > kelner -u http://localhost:61453 classify dog.jpg --top 5 --imagenet-labels boxer: 0.977385 Saint Bernard: 0.001139 Crock Pot: 0.000344 bull mastiff: 0.000275 Boston bull: 0.000214
  7. • モデルファイルを読む • Keras + TF (とりあえず) • HTTPのエンドポイント •

    JSON ↔ Tensor 翻訳 • バイナリデータもできる • MIT ライセンス • ★★★★ on Github KELNER
  8. FINE PRINT Kelner logo thanks to freelogodesign.org. Octocat images property

    of Github, used to symbolize various types of github-using developers who interact with Kelner. Logos of AWS services, Rails, Kotlin, Swift, Android, Docker and other, used to identify the respective services and languages. Time taken to develop Kelner courtesy of wonderful work atmosphere of Cookpad Inc., making everyday cooking FUN (and coding too)!