관리 메뉴

Hee'World

TensorFlow 설치 본문

Programming/Python

TensorFlow 설치

Jonghee Jeon 2016. 6. 7. 12:51

<TensorFlow 설치>


설치환경

 - Ubuntu Server 14.04.4

 - Virtualenv

 - Python 2.7.11



1. Virtualenv 환경에서 설치환경에 맞게 설치를 진행한다.

 - 저는 pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl로 설치 진행하였습니다.


 * Python 2

# Ubuntu/Linux 64-bit, CPU only:

(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl


# Ubuntu/Linux 64-bit, GPU enabled. Requires CUDA toolkit 7.5 and CuDNN v4.  For

# other versions, see "Install from sources" below.

(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl


# Mac OS X, CPU only:

(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py2-none-any.whl


 * Python 3

# Ubuntu/Linux 64-bit, CPU only:

(tensorflow)$ pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl


# Ubuntu/Linux 64-bit, GPU enabled. Requires CUDA toolkit 7.5 and CuDNN v4.  For

# other versions, see "Install from sources" below.

(tensorflow)$ pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl


# Mac OS X, CPU only:

(tensorflow)$ pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0-py3-none-any.whl



2. python에 접속 후 import tensorflow as tf를 입력하여 설치를 확인합니다.



 - 간단히 예제코드를 실행하여 봅니다

import tensorflow as tf


hello = tf.constant("Hello, TensorFlow!!")

sess = tf.Session()

print(sess.run(hello))


a = tf,constant(10)

b = tf.constant(32)


print(sess.run(a + b))


<끝>





 - https://www.tensorflow.org/versions/r0.8/get_started/os_setup.html#virtualenv-installation

Comments