スポンサーリンク

Keras+Flaskのコードをダウンロードして実行してみる

下記サイトを写経してみる!本当はGitHubniコードがあるとうれしいのだけれど、、、うまくいくかなあ。。。

https://recipe.narekomu-ai.com/2017/10/chainer_web_demo_1/

前回、

mnist-cnn.model

という名前で、MNISTをtrainingしたモデルを保存してある。

(1)

predict.py
templates/
index.html
static/

python predict.py

http://labs.timedia.co.jp/2017/02/chainersaveload1.html

がんばったが、だめだった。このエラー。無理ぽ。

image

image

下記コードはエラーで動かない。

https://gist.github.com/adash333/c895b792eca527701ffca54f9dc59331

(2)以下を写経してみたい。こちらはKeras。。。

せっかくChainer勉強したのに、、、

https://github.com/msrks/keras_num_pred

ZIPファイルをダウンロードして、解凍。

Anaconda promptを起動。

KerasとTensorflowがインストールされている環境で、

python app.py

ブラウザで、localhost:5002 を開く。

image

できた!これはすごい。

またKerasを勉強するのかな。。。

(3)こちらも試してみる

https://github.com/llSourcell/how_to_deploy_a_keras_model_to_production

だめだった。

Tensorflowが0.11だからか。。。

image

 

次は、こちらのDjangoのものを写経してみたい。

https://torina.top/detail/332/
image

スポンサーリンク