::: Zany's Homepage ::: Zany Wiki | »çÀÌÆ® ÅëÇÕ °Ë»ö
 
 
 

tensorflow over python Ãʱ⠱¸¼º

°Ô½ÃÆÇ
Python
ÀÛ¼ºÀÚ
helix
ÀÛ¼ºÀÏ
2017-11-06 14:50:12
ÀÐÀº¼ö
1183
ÆòÁ¡
   
Ç¥½Ã¿É¼Ç
HTML»ç¿ë | ÀÚµ¿BRűנ| °ø¹é¹®ÀÚÇã¿ë | °¡¿îµ¥Á¤·Ä | °íÁ¤Æø±Û²Ã | ÀÚµ¿URL¸µÅ© | ¸¶¿ì½º¼±ÅÃ
°ü·Ã¸µÅ©01
https://www.tensorflow.org/install 
°ü·Ã¸µÅ©02
https://www.tensorflow.org/install/install_linux#ValidateYourInstallation 
¡Ü pip ¸í·ÉÀ¸·Î Python 'virtualenv' ¸¦ ¼³Ä¡Çϰųª ¾÷±×·¹À̵å ÇÑ´Ù.
pip install --upgrade virtualenv
[zany@hermes virtual]$ pip install --upgrade virtualenv
Requirement already up-to-date: virtualenv in /home/zany/usr/tools/python/python-3.6.3/lib/python3.6/site-packages

¡Ü Python 3 ¸¦ »ç¿ëÇÏ¿© tensorflow °¡»ó ȯ°æ »ý¼º
virtualenv --system-site-packages -p python3 tensorflow
[zany@hermes virtual]$ virtualenv --system-site-packages -p python3 tensorflow
Running virtualenv with interpreter /home/zany/usr/tools/python/current/bin/python3
Using base prefix '/home/zany/usr/tools/python/current'
New python executable in /home/zany/usr/tools/python/virtual/tensorflow/bin/python3
Also creating executable in /home/zany/usr/tools/python/virtual/tensorflow/bin/python
Installing setuptools, pip, wheel...done.
tensorflow °¡»ó ȯ°æÀÌ »ý¼ºµÇ¾ú´ÂÁö È®ÀÎÇÑ´Ù.
ÇöÀç µð·ºÅ丮¿¡ 'tensorflow' µð·ºÅ丮°¡ »ý°åÀ¸¸é µÈ´Ù.
[zany@hermes virtual]$ ls
crypto  flask  tensorflow

¡Ü tensorflow °¡»ó ȯ°æ ·Îµå
tensorflow °¡»ó ȯ°æÀ» ·ÎµåÇÏ°í,
1) ÇÁ·ÒÇÁÆ®°¡ (°¡»óȯ°æÀ̸§) PS ·Î ¹Ù²î¾ú´ÂÁö È®ÀÎÇÑ´Ù.
2) Á¦´ë·Î ·ÎµåµÇ¾ú´ÂÁö È®ÀÎÇϱâ À§ÇØ which ¸í·ÉÀ¸·Î python ¸í·É¾î¿Í pip ¸í·ÉÀÌ ¾îµð ÀÖ´ÂÁö È®ÀÎÇÑ´Ù.
"°¡»ó ȯ°æ/bin" µð·ºÅ丮¸¦ °¡¸®Å°°í ÀÖÀ¸¸é OK.
. ./tensorflow/bin/activate
¶Ç´Â
source ./tensorflow/bin/activate
[zany@hermes virtual]$ . ./tensorflow/bin/activate
(tensorflow) [zany@hermes virtual]$

(tensorflow) [zany@hermes virtual]$ which python
~/usr/tools/python/virtual/tensorflow/bin/python

(tensorflow) [zany@hermes virtual]$ which pip
~/usr/tools/python/virtual/tensorflow/bin/pip

¡Ü tensorflow ¸ðµâ ¼³Ä¡
pip install --upgrade tensorflow
(tensorflow) [zany@hermes virtual]$ pip install --upgrade tensorflow
Collecting tensorflow
  Downloading tensorflow-1.4.0-cp36-cp36m-manylinux1_x86_64.whl (41.2MB)
    100% |████████████████████████████████| 41.2MB 29kB/s
Collecting numpy>=1.12.1 (from tensorflow)
  Downloading numpy-1.13.3-cp36-cp36m-manylinux1_x86_64.whl (17.0MB)
    100% |████████████████████████████████| 17.0MB 94kB/s
Collecting tensorflow-tensorboard<0.5.0,>=0.4.0rc1 (from tensorflow)
  Downloading tensorflow_tensorboard-0.4.0rc2-py3-none-any.whl (1.7MB)
    100% |████████████████████████████████| 1.7MB 938kB/s
Collecting six>=1.10.0 (from tensorflow)
  Downloading six-1.11.0-py2.py3-none-any.whl
Collecting protobuf>=3.3.0 (from tensorflow)
  Downloading protobuf-3.4.0-cp36-cp36m-manylinux1_x86_64.whl (6.2MB)
    100% |████████████████████████████████| 6.2MB 266kB/s
Requirement already up-to-date: wheel>=0.26 in ./tensorflow/lib/python3.6/site-packages (from tensorflow)
Collecting enum34>=1.1.6 (from tensorflow)
  Downloading enum34-1.1.6-py3-none-any.whl
Collecting bleach==1.5.0 (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow)
  Downloading bleach-1.5.0-py2.py3-none-any.whl
Collecting markdown>=2.6.8 (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow)
  Downloading Markdown-2.6.9.tar.gz (271kB)
    100% |████████████████████████████████| 276kB 4.0MB/s
Collecting werkzeug>=0.11.10 (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow)
  Using cached Werkzeug-0.12.2-py2.py3-none-any.whl
Collecting html5lib==0.9999999 (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow)
  Downloading html5lib-0.9999999.tar.gz (889kB)
    100% |████████████████████████████████| 890kB 1.7MB/s
Requirement already up-to-date: setuptools in ./tensorflow/lib/python3.6/site-packages (from protobuf>=3.3.0->tensorflow)
Building wheels for collected packages: markdown, html5lib
  Running setup.py bdist_wheel for markdown ... done
  Stored in directory: /home/zany/.cache/pip/wheels/bf/46/10/c93e17ae86ae3b3a919c7b39dad3b5ccf09aeb066419e5c1e5
  Running setup.py bdist_wheel for html5lib ... done
  Stored in directory: /home/zany/.cache/pip/wheels/6f/85/6c/56b8e1292c6214c4eb73b9dda50f53e8e977bf65989373c962
Successfully built markdown html5lib
Installing collected packages: numpy, six, html5lib, bleach, markdown, werkzeug, protobuf, tensorflow-tensorboard, enum34, tensorflow
Successfully installed bleach-1.5.0 enum34-1.1.6 html5lib-0.9999999 markdown-2.6.9 numpy-1.13.3 protobuf-3.4.0 six-1.11.0 tensorflow-1.4.0 tensorflow-tensorboard-0.4.0rc2 werkzeug-0.12.2
(tensorflow) [zany@hermes virtual]$

¡Ü ¼³Ä¡ °ËÁõ
python ÄܼÖÀ» ¿­¾î, ¾Æ·¡ Äڵ尡 µ¿ÀÛÇϸé Á¤»ó.
(tensorflow) [zany@hermes virtual]$ python
Python 3.6.3 (default, Nov  2 2017, 20:07:42)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
/home/zany/usr/tools/python/virtual/tensorflow/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6
  return f(*args, **kwds)
>>> import os
>>> os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
>>> hello = tf.constant('hello, tensorflow')
>>> sess = tf.Session()
>>> print(sess.run(hello))
b'hello, tensorflow'
>>>

¡Ü °¡»óȯ°æ ºüÁ®³ª°¡±â
deactivate
(tensorflow) [zany@hermes virtual]$ deactivate
[zany@hermes virtual]$

 °Ô½ÃÆÇ ±Û ¸ñ·Ï
No Subject Poster Hits Posted
helix 1183 2017-11-06 14:50:12
14221 helix 621 2017-11-06 14:39:42
ÄÚ¸àÆ®
ÀÛ¼ºÀÚ
                       
 
zany.kr
  Copyright ¨Ï 2002-2010 Zany's Programming Lab. All Rights Not Reserved.
temporary This Page loads on 0.016 Secs