LoginSignup
5
5

More than 5 years have passed since last update.

ofxMSATensorFlowを試してみた (mnist)

Last updated at Posted at 2016-08-13

ofxMSATensorFlow

oFでTensorFlowを使えるアドオンを試してみた

openFrameWorks:http://openframeworks.cc/
TensorFlow:https://www.tensorflow.org/versions/r0.10/tutorials/index.html
ofxMSATensorFlow:https://github.com/memo/ofxMSATensorFlow

環境

Mac OSX El Capitan(10.11.6)
oF 0.9.3

1. example-mnist

手書き数字認識
下記を参考にさせていただき、無事に実行できました

http://qiita.com/yoppa/items/229507e6300ee18793ad

コマンドラインでの実行

せっかくなので、コマンドラインで実行の仕方も書いておきます

$ brew install wget
$ cd of_v0.9.3_osx_release/addons/
$ git clone https://github.com/memo/ofxMSATensorFlow
  • ライブラリファイルをダウンロードして配置
$ wget https://github.com/memo/ofxMSATensorFlow/releases/download/v0.0/ofxMSATensorFlow_lib_OSX_2016_02_21_v0.7_CPU.zip
$ unzip ofxMSATensorFlow_lib_OSX_2016_02_21_v0.7_CPU.zip
$ mkdir ~/lib
$ cp osx/libtensorflow_cc.so ~/lib/.
$ cp osx/libtensorflow_cc.so ofxMSATensorflow/libs/tensorflow/lib/osx/.

(上ではライブラリファイルを2か所に配置していますが、どちらが参照されているかわからなかった(!)ためです)

  • 学習済みモデルをダウンロードして配置
$ cd ofxMSATensorflow/example-mnist/bin
$ wget https://github.com/memo/ofxMSATensorFlow/releases/download/v0.0/example-mnist-data.tar.gz
$ tar xzvf example-mnist-data.tar.gz
  • 実行
$ cd ../
$ make
$ make run

うまくいけばGUIが表示されて、数字を書くと認識してくれます。
Screen Shot 2016-08-18 at 4.24.48 PM.png

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