LoginSignup
16
17

More than 5 years have passed since last update.

Ubuntuで人工知能・機械学習(TensorFlow、Caffe)を試す環境を作るansible playbookを作りました。

Last updated at Posted at 2016-09-29

Ubuntuで人工知能・機械学習(TensorFlow、Caffe)を試す環境を作るansible playbookを作りました。

TensorFlowはともかく、Caffeは設定も少々あったりで時間がかかるので
すぐに実行環境を作れるようにansibleで書きました。

今後他の機械学習フレームワークの追加とMac対応をする予定です。

参考
https://www.amazon.co.jp/dp/B01LXSSR7X/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1

---
- name: 基本パッケージをインストール
  apt: name={{item}} state=present update_cache=yes
  with_items:
      - libatlas-base-dev
      - libprotobuf-dev
      - libleveldb-dev
      - libsnappy-dev
      - libopencv-dev
      - libboost-all-dev
      - libhdf5-serial-dev
      - libgflags-dev
      - libgoogle-glog-dev
      - liblmdb-dev
      - protobuf-compiler
#      - g++-4.6
      - hardening-wrapper

#- name: Install -y g++-4.6
#  shell: apt-get install -y g++-4.6

- name: git clone Caffe
  shell: chdir=~/ git clone https://github.com/BVLC/Caffe
  become: no

- name: Makefile.config
  shell: cp ~/Caffe/Makefile.config.example ~/Caffe/Makefile.config
  become: no

- name: Makefile.config CPU_ONLY := 1
  shell: sed -i -e 's/# CPU_ONLY := 1/CPU_ONLY := 1/g' ~/Caffe/Makefile.config
  become: no

- name: Makefile.config CUSTOM_CXX := g++-4.6
  shell: sed -i -e 's/# CUSTOM_CXX := g++/CUSTOM_CXX := g++-4.6/g' ~/Caffe/Makefile.config
  become: no

- name: make
  command: chdir=~/Caffe make
  become: no

- name: make test
  shell: chdir=~/Caffe make test
  become: no

- name: make runtest
  shell: chdir=~/Caffe make runtest
  become: no
16
17
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
16
17