Slide 1

Slide 1 text

Kelner Serve Your Models

Slide 2

Slide 2 text

Who is this? ● Leszek Rybicki リビツキ レシェック github: @lunardog ● 2016からCookpadで画像解析 ● 理化学研究所のラボで 務めていたことある

Slide 3

Slide 3 text

機械学習のモデルを デプロイするのは 難しいですか?

Slide 4

Slide 4 text

@la t

Slide 5

Slide 5 text

@la t

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

@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

Slide 8

Slide 8 text

KELNER

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

> 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 !

Slide 11

Slide 11 text

> 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

Slide 12

Slide 12 text

● モデルファイルを読む ● Keras + TF (とりあえず) ● HTTPのエンドポイント ● JSON ↔ Tensor 翻訳 ● バイナリデータもできる ● MIT ライセンス ● ★★★★ on Github KELNER

Slide 13

Slide 13 text

以上 Questions? Issues? Pull Requests?

Slide 14

Slide 14 text

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)!

Slide 15

Slide 15 text

https://info.cookpad.com/careers