===== 2016년 5월 당시 설치 기준입니다. =====
GPU 연산 포함
NVIDIA Cuda Toolkit Ver 7.5
Cudann 4.0
TensorFlow 설치
Pip Installation
$ sudo apt-get install python-pip python-dev
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl
Virtualenv installation
$ sudo apt-get install python-pip python-dev python-virtualenv
$ virtualenv --system-site-packages ~/tensorflow
$ source ~/tensorflow/bin/activate
(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl
(tensorflow)$ deactivate
설치 필요 프로그램
Install Bazel
패키지 의존성 : http://bazel.io/docs/install.html
.sh 파일 설치 : https://github.com/bazelbuild/bazel/releases
$ chmod +x PATH_TO_INSTALL.SH
$ ./PATH_TO_INSTALL.SH --user
Install other dependencies
Install other dependencies
$ sudo apt-get install python-numpy swig python-dev
Download and install Cuda Toolkit(Ver 7.5)
https://developer.nvidia.com/cuda-downloads
Install version 7.5 if using our binary releases.
Install the toolkit into e.g. /usr/local/cuda
Download and install cuDNN(Ver 4.0)
https://developer.nvidia.com/cudnn
Download cuDNN v4 (v5 is currently a release candidate and is only supported when installing TensorFlow from sources).
Uncompress and copy the cuDNN files into the toolkit directory. Assuming the toolkit is installed in/usr/local/cuda
, run the following commands (edited to reflect the cuDNN version you downloaded):
파일 복사
$ tar xvzf cudnn-7.5-linux-x64-v4.tgz
$ sudo cp cudnn-7.5-linux-x64-v4/cudnn.h /usr/local/cuda/include
$ sudo cp cudnn-7.5-linux-x64-v4/libcudnn* /usr/local/cuda/lib64
$ sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
~/.profile 가장 아래 부분에
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64"
export CUDA_HOME=/usr/local/cuda
설치 테스트
홈 디렉터리에서
$ source ~/tensorflow/bin/activate
입력 후$ python
...
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
Hello, TensorFlow!
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print(sess.run(a + b))
42
>>>
'인공지능' 카테고리의 다른 글
tensorflow 설치 완료 (0) | 2016.12.11 |
---|