¸Ó½Å·¯´×(Tensorflow) »ç¿ë±â 2 (Tensorflow ¼³Ä¡)

   Á¶È¸ 25169   Ãßõ 8    

안녕Ȣ16;세요

Tensorflow .160;번1704; 강1340; 1077;니다.


1060; 강1340;lj16; Tensorflow 홈6168;1060;1648;에 나와1080;lj16; 과1221;1012; 따라해 본 내용1077;니다.

원문1012; 보고 dz10;1004;시면 아래 링크를 참1312; 해 1452;세요

https://www.tensorflow.org/versions/r0.9/get_started/os_setup.html#download-and-setup


Tensorflow lj16; 리눅스 환ᅆ1;에서 ᇼ1;1089;Ȣ16;고 Python 1004;/196; 실행.121;니다.

따라서 리눅스와 Python1012; 기본1004;/196; 설치해야 Ȣ16;고

,144;기에 Tensorflow를 추가/196; 설치 해야 합니다.


1060;를 위해서 크,172;보면 3가1648; 0169;법1060; 가능한데요

1. 리눅스에 파1060;선1012; 설치Ȣ16;lj16; 법

2. 리눅스에 가상 파1060;선 환ᅆ1;1012; 설치(Virtualenv, Anaconda) Ȣ16;lj16; 법

3. Windows에 Docker를 설치Ȣ16;고 그 위에서 실행 Ȣ16;lj16; 법


가상 파1060;선 환ᅆ1;1012; 구축Ȣ16;lj16; ,163;1060; 여러프/196;1229;트를 1652;행 할ǐ12;lj16;

1339;다고 Ȣ16;lj16;데 오늘1008; 1228;1068; 기본1060; .104;lj16; 1번 0169;법1012; 1060;용해서 설치 해 보,192;습니다.


가. 리눅스가 설치.104;Ǻ12; 1080;lj16; 머신1060; 1080;다고 가122116;고 1652;행Ȣ16;,192;습니다.

    1200;lj16; google cloud에서 Virtual machine1012; 사용해서 환ᅆ1;1012; 구축했습니다.

    사용해 보니 1339;더라구요. 클릭 ኧ1;번1004;/196; 원Ȣ16;lj16; 코Ǻ12;에 원Ȣ16;lj16; 운영체1228;/196;

    가상 머신1012; 만들Ǻ12; 1469;니다.

    개0156; 환ᅆ1;1008; Ubuntu14.04 LTS /196; 1652;행 했습니다.  


나. Python 설치

   Ubuntu14.04에lj16; 기본1004;/196; python 2.7.61060; 설치 .104;Ǻ12; 1080;습니다.


다. PIP를 설치 해 1469;니다.

   sudo apt-get install python-pip python-dev

   1060;,163;1008; Python1004;/196; 1089;성.108; Library를 관리Ȣ16;lj16; 프/196;그ǖ16;1004;/196;

   Python에서 Ȣ16;나1032; 라1060;브러리를 사용Ȣ16;/140;면 다른 라1060;브러리에 1032;1316;성1060; 1080;Ǻ12;서

   다른 필요한 ,163;들1012; 설치 해 1480;야 합니다.

   설치가 한번에 .104;1648; 않1012; 수 1080;lj16;데요      위와 같1008; 에러가 0156;생Ȣ16;면 sudo apt-get update 를 해 1452;시고

   sudo apt-get install python-pip 를 실행 켜1452;시면 완료 .121;니다.


라. Tensorflow 설치

  텐서플/196;우에lj16; 여러가1648; 버1204;1060; 1080;습니다.

  Python 버1204;별/196; 설치 버1204;1060; 달라1648;고 GPU 1060;용여ǥ12;에 따라서도 버1204;1060;달라1665;니다.

  1228; PClj16; CPU 0150;에 없Ǻ12;서 CPU only, Python 2.7 버1204;1004;/196; 설치 해 보,192;습니다.

# Ubuntu/Linux 64-bit, CPU only, Python 2.7
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 2.7 
# Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl

# Mac OS X, CPU only, Python 2.7:
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py2-none-any.whl

# Ubuntu/Linux 64-bit, CPU only, Python 3.4
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.4 
# Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl

# Ubuntu/Linux 64-bit, CPU only, Python 3.5
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl

# Ubuntu/Linux 64-bit, GPU enabled, Python 3.5 
# Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl

# Mac OS X, CPU only, Python 3.4 or 3.5:
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/tensorflow-0.9.0-py3-none-any.whl


아래 .160; 명/16112;를 실행 시켜 1452;시면 설치가 완료 .121;니다.

export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl  
sudo pip install --upgrade $TF_BINARY_URL


마. 설치 확1064;

  1096; 설치 .104;었lj16;1648; 확1064;1012; 위해서 간단한 코드를 실행 시켜 보,192;습니다.

$ python
...
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))

간단7176; 코드를 살6196;보면

Tensorflow 에서 모든 변수lj16; Tensor 라lj16; 단위/196; 처리.121;니다. (그래서 Tensorflow 1077;니다.)

tf.constant lj16; 상수형 Tensor를 생성 해 1452;lj16; 명/161;1060;고

tf.Session 1008; 텐서가 수행.104;lj16; 환ᅆ1;1012; 캡슐화 해 1469;니다.

결국 상수를 생성Ȣ16;여 Session안에 1665;Ǻ12;넣고 수행 해1452;lj16; 구1312;가 .104;,192;습니다.


또 다른 예1228;를 보면 아래와 같1060; 산술 연산도 가능합니다.

 a = tf.constant(10)
>>> b = tf.constant(32)
>>> print(sess.run(a + b))
42


1228; PC에서 수행한 결과lj16; 아래와 같습니다.


여기까1648; Ȣ16;시면 기본 설치가 완료 .121;니다.

수고Ȣ16;ǯ12;습니다.


다1020;에lj16; 간단한 모형1012; Ȣ17;습 시켜 보,192;습니다.

gpu ¹öÀüµµ ½ÃµµÇØ º¸½ÃÁö¿ä.
CUDAµµ ¾Æ¸¶ compatibility 2.1Àΰ¡ ºÎÅÍ Áö¿øÇÒ °Ì´Ï´Ù.
°¡¼Ó Á¤µµµµ ´ë´ÜÈ÷ ±Ã±ÝÇÕ´Ï´Ù
Á¡Á¡ Èï¹Ì·Ó½À´Ï´Ù. ÂÉ±Ý ¾î·Æ±âµµ ÇÕ´Ï´Ù.
Àü¹®°¡ÀÇ Åº»ýÀÔ´Ï´Ù. È­ÀÌÆÃÀÔ´Ï´Ù.
¸µÅ©Çϳª ¿¬°áÇص帳´Ï´Ù
http://www.complexity.co.kr/?p=2476
     
nshhsn 2016-07
ÇØ º¸°í ½ÍÀºµ¥ Á¦ PCµéÀº Çϳª°°ÀÌ GPU°¡ ¾ø¾î¼­¿ä
º»°ÝÀûÀ¸·Î ÇÏ°Ô µÇ¸é Àåºñ¸¦ °®ÃâÅ×´Ï ±×¶§ ÇØ º¼ ¼ö ÀÖÀ» °Í °°½À´Ï´Ù.

¾È±×·¡µµ Titan X »ç°í ½Í¾î¼­ º¸´Âµ¥ °¡°ÝÀÌ ¸¸¸¸Ä¡ ¾Ê³×¿ä
¾ó¸¥ ¸Ó½Å·¯´×¿ë Ŭ¶ó¿ìµå ¼­ºñ½º°¡ ³ª¿À±â¸¦ ±â´Ù¸®°í ÀÖ½À´Ï´Ù.
Amazon¿¡¼­´Â GPU 4°³Â¥¸® instance°¡ À־
¾Æ½¬¿îµ¥·Î ¿©±â¼­ ÇØ º¼ ¼ö ÀÖÀ» °Í °°½À´Ï´Ù.

°¨»çÇÕ´Ï´Ù.
          
computing capability 3.5ÀÌ»óÀÌ¸é °¡µ¿µÈ´Ù³×¿ä.
https://developer.nvidia.com/cuda-gpus
titan ¾Æ´Ï¶óµµ Àú·ÅÇÏ°Ô µ¹¸± ¼öµµ ÀÖ´Â ¸ð¾çÀÔ´Ï´Ù.
gtx 950 ÀÌ»óÀÌ¸é µÇ´Â °ÍÀ¸·Î ³ª¿É´Ï´Ù.
gtx950¸¸Çصµ Äھ 768°³ÀÔ´Ï´Ù.
     
ÀåÇÑÁÖ 2016-10
AMDÀÇ ½ºÆ®¸²ÇÁ·Î¼¼¼­·Î´Â ºÒ°¡´ÉÇϳª¿ä?
          
nshhsn 2016-10
GpuÂÊÀº nvidia ¸¸ µÇÁö¸¸
CpuÂÊÀº Á¦¾àÀÌ ÀÖ´Ù´Â ¾ê±â¸¦ µèÁö ¸ø Çß½À´Ï´Ù
Á¦ »ý°¢¿¡´Â ¸®´ª½º¸¸ ¼³Ä¡ µÈ´Ù¸é ¹®Á¦ ¾øÀ»°Í °°½À´Ï´Ù
          
amd cpuÀÇ  ³»Àå gpu ¸»¾¸À̽Ű¡¿ä?
±×·¸´Ù¸é ÀÌ °æ¿ì´Â nvidia°¡ ¾Æ´Õ´Ï´Ù. ¾Æ¸¶ ati
ati´Â ¾ÊµË´Ï´Ù.
               
ÀåÇÑÁÖ 2016-10
AMDÀÇ GPU Áï ATIÀÇ ±×·¡ÇÈÄ«µå±º¿¡ ÀÖ´Â ÄíµåÄÚ¾î = ½ºÆ®¸² ÇÁ·Î¼¼¼­¸¦ ¸»ÇÑ°Ì´Ï´Ù. Äí´ÙÄÚ¾î¿Í °°Àº ÆÄÁ¾ÀÔ´Ï´Ù. ±×·±µ¥ ´ëºÎºÐ Áö¿ø¾ÈÇÏ´Â°Í °°´õ¶ó°í¿ä.. À̹ø RXÁ¦Ç°µé¿¡ ½ºÆ®¸² ÇÁ·Î¼¼¼­°¡ Á¦°ÅµÈ°Í °°½À´Ï´Ù..
                    
atiÀÇ gpu´Â CUDA¸¦ Áö¿øÇÏÁö ¾Ê½À´Ï´Ù. TensorFlow´Â ±âº»ÀûÀ¸·Î CUDA ±â¹ÝÀ̱⠶§¹®¿¡
ati ±â¹Ý gpu´Â TensorFlow »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù. ati¿ëÀº openCLÀÌ Àִµ¥ TensorFlow´Â
openCL Áö¿øÇÏÁö ¾Ê½À´Ï´Ù. ¾ÕÀ¸·Î´Â Áö¿øµÉ °ÍÀ¸·Î º¾´Ï´Ù¸¸..
hyhyhy 2016-12
sudo pip install --upgrade $TF_BINARY_URLÀ» ÀÔ·ÂÇϴϱî
The directory '/home/USERRR/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/USERRR/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl is not a supported wheel on this platform.
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.¶ó°í ¶ß¸é¼­ ÅÙ¼­Ç÷ο켳ġ°¡ µÇÁö¾Ê½À´Ï´Ù.. ¿µ¾î°íÀÚ¶ó ¸·¸·Çϳ׿ä. ¾î¶»°Ô ÇϸéµÇ´ÂÁö..

USERRR@PC-GOGO:~$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named tensorflow


Á¦¸ñPage 1/26
2014-07   24562   ºÐ³ëÀÇ´Ù¿îÈú
2015-02   37160   ȲÁø¿ì
2018-03   43223   PAiNrel
2018-08   17521   ¾îÂÞ
2019-04   25601   ÇÁ·Î½Ã¾Æ
2019-07   19739   ½ºÄµl¹ÎÇö±â
2019-11   9281   FOXBI
2020-05   11682   ³«¿±À̽½1
2020-08   8722   Tails
2021-05   9789   µö·¯´×¼­¹ö
2021-08   9902   µö·¯´×¼­¹ö
2022-01   6079   ¹Ú¹®Çü
2022-03   8949   ¹ÌÄ£°¨ÀÚ
2022-07   22531   µö·¯´×¼­¹ö
2022-12   43258   ÃѾËź»ç³ªÀÌ
2023-04   38240   µö·¯´×¼­¹ö
2023-09   53019   µö·¯´×¼­¹ö
01-25   9773   µö·¯´×¼­¹ö
2012-02   33163   ÀÌÁöÆ÷Åä
2019-07   13575   »ßµ¹À̽½ÇÄÀÌ