Take off

블로그 이미지
by 안.들
  • Total hit
  • Today hit
  • Yesterday hit

'jupyter'에 해당되는 글 1건

  1. 2016.11.30
    tensorflow installation.



tensorflow.org참조


https://www.python.org/downloads/release/python-352/ 에서 

PC에 맞는 Pip프로그램 다운로드

Windows x86-64 executable installer Windows for AMD64/EM64T/x64, not Itanium processors

*local PC프로세서 확인
-----------------------------------------

-----------------------------------------

windows는 아나콘다버전을 추천하네.(refer, https://tensorflow.blog/)

https://www.continuum.io/downloads#windows

아나콘다버전은 path설정까지 되어 pip 명령어를 command 창에서 실행가능함


To install the CPU-only version of TensorFlow

C:\Users\Administrator>pip install --upgrade https://storage.googleapis.com/tens

orflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl

Collecting tensorflow==0.12.0rc0 from https://storage.googleapis.com/tensorflow/

windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl

  Downloading https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0

.12.0rc0-cp35-cp35m-win_amd64.whl (12.2MB)

    100% |################################| 12.2MB 37kB/s

Collecting numpy>=1.11.0 (from tensorflow==0.12.0rc0)

  Downloading numpy-1.11.2-cp35-none-win_amd64.whl (7.6MB)

    100% |################################| 7.6MB 74kB/s

Requirement already up-to-date: wheel>=0.26 in c:\program files\anaconda3\lib\si

te-packages (from tensorflow==0.12.0rc0)

Collecting protobuf==3.1.0 (from tensorflow==0.12.0rc0)

  Downloading protobuf-3.1.0-py2.py3-none-any.whl (339kB)

    100% |################################| 348kB 1.3MB/s

Requirement already up-to-date: six>=1.10.0 in c:\program files\anaconda3\lib\si

te-packages (from tensorflow==0.12.0rc0)

Collecting setuptools (from protobuf==3.1.0->tensorflow==0.12.0rc0)

  Downloading setuptools-29.0.1-py2.py3-none-any.whl (472kB)

    100% |################################| 481kB 898kB/s

Installing collected packages: numpy, setuptools, protobuf, tensorflow

  Found existing installation: numpy 1.11.1

    Uninstalling numpy-1.11.1:

      Successfully uninstalled numpy-1.11.1

  Found existing installation: setuptools 27.2.0

Cannot remove entries from nonexistent file c:\program files\anaconda3\lib\site-

packages\easy-install.pth

You are using pip version 8.1.2, however version 9.0.1 is available.

You should consider upgrading via the 'python -m pip install --upgrade pip' comm

and.


C:\Users\Administrator>


C:\Users\Administrator>python -m pip install --upgrade pip

Collecting pip

  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)

    100% |################################| 1.3MB 426kB/s

Installing collected packages: pip

  Found existing installation: pip 8.1.2

    Uninstalling pip-8.1.2:

      Successfully uninstalled pip-8.1.2

Successfully installed pip-9.0.1


To install the GPU version of TensorFlow

C:\Users\Administrator>pip install --upgrade https://storage.googleapis.com/tens

orflow/windows/gpu/tensorflow_gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl

Collecting tensorflow-gpu==0.12.0rc0 from https://storage.googleapis.com/tensorf

low/windows/gpu/tensorflow_gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl

  Downloading https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_g

pu-0.12.0rc0-cp35-cp35m-win_amd64.whl (32.5MB)

    100% |################################| 32.5MB 7.9kB/s

Collecting protobuf==3.1.0 (from tensorflow-gpu==0.12.0rc0)

  Using cached protobuf-3.1.0-py2.py3-none-any.whl

Requirement already up-to-date: numpy>=1.11.0 in c:\program files\anaconda3\lib\

site-packages (from tensorflow-gpu==0.12.0rc0)

Requirement already up-to-date: six>=1.10.0 in c:\program files\anaconda3\lib\si

te-packages (from tensorflow-gpu==0.12.0rc0)

Requirement already up-to-date: wheel>=0.26 in c:\program files\anaconda3\lib\si

te-packages (from tensorflow-gpu==0.12.0rc0)

Collecting setuptools (from protobuf==3.1.0->tensorflow-gpu==0.12.0rc0)

  Using cached setuptools-29.0.1-py2.py3-none-any.whl

Installing collected packages: setuptools, protobuf, tensorflow-gpu

  Found existing installation: setuptools 27.2.0

Cannot remove entries from nonexistent file c:\program files\anaconda3\lib\site-

packages\easy-install.pth


C:\Users\Administrator>

------------------


Docker Toolbox

If you have an earlier Windows system that doesn’t meet the Docker for Windows requirements, get Docker Toolbox.

See Docker Toolbox Overview for help on installing Docker with Toolbox.

The Docker Toolbox setup does not run Docker natively on Windows. Instead, it uses docker-machine to create and attach to a virtual machine (VM). This machine is a Linux VM that hosts Docker for you on your Windows system.

Requirements

To run Docker, your machine must have a 64-bit operating system running Windows 7 or higher. Additionally, you must make sure that virtualization is enabled on your machine. For details, see the Toolbox install instructions for Windows.


windows 8 사용하는 나는 Docker toolbox설치.

설치 가이드 

https://docs.docker.com/toolbox/toolbox_install_windows/

설치파일 : https://www.docker.com/products/docker-toolbox
DockerToolbox-1.12.3.exe

참고) https://medium.com/@suhaas/how-to-install-tensorflow-on-windows-8-all-glitches-gotchas-covered-4725b73626a5#.ubsg6dj01


바로가기 : Docker Quickstart Terminal 실행

Creating CA: C:\Users\Administrator\.docker\machine\certs\ca.pem
Creating client certificate: C:\Users\Administrator\.docker\machine\certs\cert.pem

Running pre-create checks...
Creating machine...
(default) Copying C:\Users\Administrator\.docker\machine\cache\boot2docker.iso to C:\Users\Administrator\.docker\machine\machines\default\boot2docker.iso...

(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Windows might ask for the permission to create a network adapter. Sometimes, such confirmation window is minimized in the taskbar.

(default) Found a new host-only adapter: "VirtualBox Host-Only Ethernet Adapter#2"

(default) Windows might ask for the permission to configure a network adapter. Sometimes, such confirmation window is minimized in the taskbar.

(default) Windows might ask for the permission to configure a dhcp server. Sometimes, such confirmation window is minimized in the taskbar.

(default) Waiting for an IP...

Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...

Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!

To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: C:\Program Files\Docker Toolbox\docker-machine.exe env default

                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/

docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com
Start interactive shell

Administrator@WIN-D8C41MUFQ7T MINGW64 ~


Prompt에서 다음명령어 실행해서 docker가 정상수행하는지 확인 아래처럼 나오면 정상작동하고 있는것임.

$ docker run hello-world

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world

c04b14da8d14: Pull complete
Digest: sha256:0256e8a36e2070f7bf2d0b0763dbabdd67798512411de4cdcf9431a1feb60fd9
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker Hub account:
https://hub.docker.com
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/Administrator@WIN-D8C41MUFQ7T MINGW64 ~

$


$ docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
default   *        virtualbox   Running   tcp://192.168.99.100:2376           v1.12.3

*두번째 docker-machine만들기

$ docker-machine create vdocker -d virtualbox

Running pre-create checks...
Creating machine...
(vdocker) Copying C:\Users\Administrator\.docker\machine\cache\boot2docker.iso to C:\Users\Administrator\.docker\machine\machines\vdocker\boot2docker.iso...

(vdocker) Creating VirtualBox VM...
(vdocker) Creating SSH key...
(vdocker) Starting the VM...
(vdocker) Check network to re-create if needed...
(vdocker) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...Docker is up and running!

To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: C:\Program Files\Docker Toolbox\docker-machine.exe env vdocker

Administrator@WIN-D8C41MUFQ7T MINGW64 ~

$

$ docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
default   *        virtualbox   Running   tcp://192.168.99.100:2376           v1.12.3
vdocker   -        virtualbox   Running   tcp://192.168.99.101:2376           v1.12.3


-------------

windows의 cmd창에서

C:\Users\Administrator>FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd vdocker') DO %i
C:\Users\Administrator>SET DOCKER_TLS_VERIFY=1
C:\Users\Administrator>SET DOCKER_HOST=tcp://192.168.99.101:2376
C:\Users\Administrator>SET DOCKER_CERT_PATH=C:\Users\Administrator\.docker\machine\machines\vdocker
C:\Users\Administrator>SET DOCKER_MACHINE_NAME=vdocker
C:\Users\Administrator>REM Run this command to configure your shell:
C:\Users\Administrator>REM      @FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd vdocker') DO @%i

C:\Users\Administrator>

--

docker실행

C:\Users\Administrator>docker run -it -p 8888:8888 gcr.io/tensorflow/tensorflow

Unable to find image 'gcr.io/tensorflow/tensorflow:latest' locally

latest: Pulling from tensorflow/tensorflow

6c953ac5d795: Pull complete
3eed5ff20a90: Pull complete
f8419ea7c1b5: Pull complete
51900bc9e720: Pull complete
a3ed95caeb02: Pull complete

ebb77ce6e1c6: Pull complete

c145c1f339f5: Pull complete

9528c5352798: Pull complete

c1f8f4c880d4: Pull complete

f5d83de9c678: Pull complete

d819f1ec59a0: Pull complete

bfc1d5e3de1c: Pull complete

182b64c1f020: Pull complete

Digest: sha256:e4bfa434c53e604d582f73f3c8c9b6d7fb9ece563b3bd7eb89a20b76b8bd48c7

Status: Downloaded newer image for gcr.io/tensorflow/tensorflow:latest

[I 20:40:40.719 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret

[W 20:40:40.775 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.

[W 20:40:40.776 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using authentication. This is highly insecure and n

ot recommended.

[I 20:40:40.844 NotebookApp] Serving notebooks from local directory: /notebooks

[I 20:40:40.845 NotebookApp] 0 active kernels

[I 20:40:40.846 NotebookApp] The Jupyter Notebook is running at: http://[all ip addresses on your system]:8888/

[I 20:40:40.848 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).


이상태에서 jupyter로 접속.

로컬에 있는 python으로는 import tensorflow 에러남

jupyter내 python2로 아래 처럼 수행하면 실행됨. 뭘까.....


위 단계에서 이게 빠졌넹. tensorflow받기.. 한것 같은데..

C:\Users\Administrator>docker run -it b.gcr.io/tensorflow/tensorflow:latest-devel

docker: An error occurred trying to connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/create: open //./pipe/docker_engine: The syst

em cannot find the file specified..

See 'docker run --help'.

C:\Users\Administrator>FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd vdocker') DO %i

C:\Users\Administrator>SET DOCKER_TLS_VERIFY=1

C:\Users\Administrator>SET DOCKER_HOST=tcp://192.168.99.101:2376

C:\Users\Administrator>SET DOCKER_CERT_PATH=C:\Users\Administrator\.docker\machine\machines\vdocker

C:\Users\Administrator>SET DOCKER_MACHINE_NAME=vdocker

C:\Users\Administrator>REM Run this command to configure your shell:

C:\Users\Administrator>REM      @FOR /f "tokens=*" %i IN ('docker-machine env --shell cmd vdocker') DO @%i


C:\Users\Administrator>docker run -it b.gcr.io/tensorflow/tensorflow:latest-devel

Unable to find image 'b.gcr.io/tensorflow/tensorflow:latest-devel' locally

latest-devel: Pulling from tensorflow/tensorflow

a64038a0eeaa: Pull complete

2ec6e7edf8a8: Pull complete

0a5fb6c3c94b: Pull complete

a3ed95caeb02: Pull complete

ed54cceb1f9b: Pull complete

219efdf5ea33: Pull complete

147d151c1430: Pull complete

48862cd9a16f: Pull complete

aa5acc667d66: Pull complete

348cc777900e: Pull complete

0872ed622c8c: Pull complete

a718d6248904: Pull complete

2b705ad62ec4: Pull complete

1f90a0184aa3: Pull complete

00278cb3e438: Pull complete

Digest: sha256:231dfe3589219e758b636f3b7d3948ef8935db53f53612c10d92441c3d6fcbc6

Status: Downloaded newer image for b.gcr.io/tensorflow/tensorflow:latest-devel

root@eb297f9585cd:~#

root@eb297f9585cd:~# python

Python 2.7.6 (default, Jun 22 2015, 17:58:13)

[GCC 4.8.2] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import tensorflow as tf

>>> hello = tf.constant('hello tensorflow is it doing well?')

>>> sess = tf.Session()

>>> print sess.run(hello)

hello tensorflow is it doing well?

>>>

>>> exit

Use exit() or Ctrl-D (i.e. EOF) to exit

>>>

root@eb297f9585cd:~#

root@eb297f9585cd:~# exit


C:\Users\Administrator>


-------------------------


구글링 잘 못해서... 이것 저것 찾아보면서 아직 하는 이유는.

local에 install된 python, ipython을 윈도우 commnad창에서 실행해서 들어갔을때

>>>import tensorflow as tf 하면 에러나서임.
그래서 아래 url의 방법으로 한번 더 시도함.

http://cheonbrave.blogspot.kr/2016/12/7-1-httpswww.html?spref=fb


이상하네..

그냥 cmd 창에서 아래 실행하면
docker run -it b.gcr.io/tensorflow/tensorflow:latest-devel

linux shell 창으로 들어가고.

거기서는 import tensorflow as tf 로 참조되네. 뭘 어떻게 해야하는가.


https://www.tensorflow.org/versions/r0.12/get_started/os_setup.html#anaconda-installation

다시보기

AND

ARTICLE CATEGORY

분류 전체보기 (66)
금융 (0)
관제 (4)
Unix (1)
Android (6)
Windows (2)
Java (4)
oracle (3)
web (3)
English (3)
Physics (1)
Books (6)
요리 (1)
Deep Learning (6)
IoT (21)
to-do list (0)
Music (1)

RECENT ARTICLE

RECENT COMMENT

CALENDAR

«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30

ARCHIVE