LoginSignup
0
0

More than 5 years have passed since last update.

ofxMSATensorflow + win10 ビルドに手間取ったのでメモ

Last updated at Posted at 2017-09-25

ofxMSATensorflowを動かすためにやったことのメモ。
GPUは今度試すとしてとりあえずCPUのみ記憶が新しいうちにメモ

Anaconda4(Pythonの仮想環境?よくわからない)をインストール
 
環境構築

\conda create -n tensorflow python=3.5 numpy git cmake swig zlib

全部入りみたいな感じでcreate後activate
Pythonは3.5が必要ポイ

\activete tensorflow
\git clone https://github.com/tensorflow/tensorflow.git
\git checkout r1.1
\mkdir camke/build
\cd build
\cmake .. -A x64 -DCMAKE_BUILD_TYPE=Release ^
-Dtensorflow_BUILD_SHARED_LIB=ON
\cmake --build . --config Release

オプションの

-Dtensorflow_BUILD_SHARED_LIB=ON

を入れるのがきも。これを入れないとtensorflow.dllができない
アドオンが1.1だったのでr1.1で試そうとしてたら、シェアドライブラリはr1.2からだった模様。
ビルドには一時間くらいかかった
tensorflow/cotrib/cmake/build/release/
内の出来立てのライブラリ

tensorflow.dll
tensorflow.exp
tensorflow.def
tensorflow.lib

達をアドオンフォルダにコピー
ofxMSATensorFlow\libs\tensorflow\lib\win
\winフォルダは勝手に作った。

libprotobuf.lib

もついでにコピー(リンクしないとビルドが通らなかったので)
ofxMSATensorFlow\libs\tensorflow内のgoogle/tensorflowそれぞれのincludeフォルダの中身は削除して
cmakeでのbuild時にできるファイルに置き換え

vs2015側は
プロジェクトのプロパティのC/C++プリプロセッサに

COMPILER_MSVC

を追加

リンカーの入力に
tensorflow.lib
libprotobuf.lib

を追加

\binの.exeができる階層に

tensorflow.dll

を追加

おしまい

参考にさせていただいたサイト
https://www.tensorflow.org/install/install_sources
https://joe-antognini.github.io/machine-learning/build-windows-tf
https://qiita.com/kat_out/items/695a91f13bfc992f70ef

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