LoginSignup
0
0

More than 5 years have passed since last update.

WEBDNNのRESNET50チュートリアルをDocker環境で試す(WebAssemblyのみ)

Posted at

TL;DR

git clone --depth 1 https://github.com/mil-tokyo/webdnn webdnn
cd webdnn
docker run --rm -v "$(pwd):/src" -it lilacs2039/debian_webasm_webdnn
# in container...
cd /src/example/resnet && python convert_resnet_keras.py --backend webassembly
# exit
docker run --rm -p 8080:80 -v "$(pwd):/usr/local/apache2/htdocs/" httpd

httpdでローカルサーバを立てたら、 http://localhost:8080/example/resnet/index.html へアクセス!

はじめに

公式のResnet50チュートリアルをDocker環境で実行する。

kerasでRESNET50モデルを入手して、WebAssembly形式に変換し、ローカルサーバで動作確認する。
WebAssemblyへの変換、ローカルサーバはそれぞれDockerで環境を用意。

WebAssemblyコンパイル環境は前記事を参照

環境

  • Windows 10 Pro
  • Docker for Windows

手順

WEBDNNをclone

  • --depth 1 オプションで、最新の1コミットのみ取得
git clone --depth 1 https://github.com/mil-tokyo/webdnn webdnn

Resnet50取得・WebAssembly変換用Dockerコンテナ起動

cd webdnn
docker run --rm -v "$(pwd):/src" -it lilacs2039/debian_webasm_webdnn

コンテナ内でResnet50取得・WebAssembly変換

  • 以下のコマンドはコンテナの中で実行のこと
# in container...
cd /src/example/resnet && python convert_resnet_keras.py --backend webassembly
# exit

httpdでローカルサーバ起動

docker run --rm -p 8080:80 -v "$(pwd):/usr/local/apache2/htdocs/" httpd

ResNet50モデルを実行

http://localhost:8080/example/resnet/index.html へアクセス
Backendにwebassemblyを指定、FrameworkにKerasを指定してRun

image.png

↑のような画面になれば成功です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0