티스토리 뷰
지난 글에서 Anaconda 환경을 설치 했습니다.
이어서 Jupiter Notebook에서 Tensorflow를 import 해 봅니다.
tensorflow라는 모듈 이름이 없다고 나오네요.
설치를 진행 해 보겠습니다.
tensorflow 홈페이지에 보면 (https://www.tensorflow.org/get_started/os_setup)
Both distributions include pip. To install the CPU-only version of TensorFlow, enter the following command at a command prompt:
C:\> pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.1-cp35-cp35m-win_amd64.whl
To install the GPU version of TensorFlow, enter the following command at a command prompt:
C:\> pip install --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-0.12.1-cp35-cp35m-win_amd64.whl
You can now test your installation.
위의 명령어를 치면 설치 된다고 합니다.
일단 CPU버전으로 설치를 해 보겠습니다.
Anaconda Prompt를 관리자 권한으로 실행합니다.
c:\ 로 이동한 후에 설치 명령을 실행합니다.
설치가 된것 같은데 jupiter notebook에서 다시 import tensorflow as tf 를 해봅니다.
여전히 동일한 현상 입니다.
Anaconda issue라는 내용을 찾아서 진행 해 보았습니다.
https://github.com/tensorflow/tensorflow/issues/647
Conda Prompt를 관리자 권한으로 실행 해 줍니다.
먼저 python 가상 환경을 생성 해 줍니다.
python=3.5 부분의 숫자를 바꾸면 원하는 버전의 Python 환경을 사용 할 수 있습니다.
생성한 환경을 Activate 시킨 후에
Tensorflow를 다시 설치 합니다.
그리고 Python을 실행 해 보았습니다.
tensorflow 명령이 실행되는 것을 보니 잘 설치 된것 같습니다.
무슨 일이 일어난 것인지 노트북을 실행 시켜 봅니다.
Conda tab에 tensorflow_env라는 것이 새로 생성되었습니다.
그런데 prompt에서 activate를 시키고 노트북을 실행시켜도
여전히 노트북에서는 Default가 root로 되어 있습니다.
이것을 tensorflow_env로 변경하고 싶으면 conda install nb_conda 를 수행하면 됩니다.
이렇게 하고 다시 노트북에 들어가보면!
파일 생성 시에 tensorflow_env 환경으로 생성이 가능해 집니다.
첫번째 Tensorflow 코드를 작성하고 마치겠습니다.
'Step By Step' 카테고리의 다른 글
Tensorflow CSV File Read 1 (0) | 2017.02.16 |
---|---|
Tensorboard 사용하기 2 (0) | 2017.02.12 |
Tensorboard 사용하기 1 (5) | 2017.02.12 |
Tensorflow Tutorial (MNIST for beginer) (0) | 2017.01.27 |
Windows Tensorflow 환경 구축 1 (Anaconda 설치) (1) | 2017.01.26 |
- Total
- Today
- Yesterday