AI를 활용한 재밌는 것들을 개발합니다

2017년 1월 1일 일요일

Using the Tensorflow slim model in Windows - 1. Installing the Tensorflow GPU version in Windows

0. Intro
1. Installing the Tensorflow GPU version in Windows
2. Download, learn and evaluate slim models
3. Learning from my images (using caltech images)
4. Using learned models
5. Creating a Python Tkinter GUI application

 To use Tensorflow on Windows, you need to download and install Anaconda3 for Python 3, then install Tensorflow.

* Installation environment
- Intel i7-6700HQ @ 2.6GHz, RAM 8GB
- Windows 10 home 64bit
- NVIDIA GEFORCE GTX 965M

1) Installing Anaconda3


 Anaconda is a platform for distributing data science related packages in Python. You can download and install more than 720 packages on this platform just as you would use Linux. And it can be used for R and Scala as well as for Python. Tensoflow can be easily installed in Anaconda just like any other package.

Let's install Anaconda. First of all, I'll go to the Anaconda homepage.

Https://www.continuum.io/downloads

 I am downloading Python 3.5 version 64 bit. When the installer is finished downloading and asking for the current user or full user installation option during the installation, you can choose anything, but I installed it as an option for all users. I use my computer only.


 Installation is complete. Jupyter Notebook is basically covered. But ... but ... I can not see the anaconda executable file. Which run should Anaconda run? ??? Do not be surprised if you run cmd.exe, that's the anaconda. Is it amazing? We'll look at how to use it later when installing Tensorflow.

2) Installing CUDA and cuDNN


 To use the GPU, you need to have a NVIDIA graphics card installed that supports CUDA. NVIDIA is doing very well nowadays with the deep running craze. I attended the conference once, but it was big and the lunch box I served was delicious, and the gift was good and very fun. You can not use CUDA if you have only a graphics card installed. You need to go to the NVIDIA homepage and install the CUDA library and the CUDNN library.

CUDA download https://developer.nvidia.com/cuda-downloads


 When you run the downloaded file, it will be installed automatically. You can see if it is installed or not by installing the Visual Studio solution source code among the installed folders and running it to compile and run it. There are many people who do not have visual studio, so let's take a look at CUDA programming next time. Most of them will be well installed.

Download CUDNN at https://developer.nvidia.com/cudnn

 cuDNN stands for CUDA Deep Neural Network library. In other words, it is a specialized library for learning Deep Learning while using CUDA. The current cuDNN 5 is about twice as fast as the cuDNN 4, and the learning speed is three times faster. If you want to speed up your learning faster, you must install cuDNN.

 It is not an executable file but a compressed file. If you unzip it, you will only have a lot of real library files. Do not panic ... Copy it to the folder where CUDA is installed.

 You can copy the cuDNN file to bin, include, lib in the C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0 folder.

3) Install Tensorflow


 Finally, install Tensorflow. In fact, the installation process is very easy to do. It's really easy.

First press the Windows key + R, hit cmd and hit enter. The prompt window will launch.


 Do not panic... This is anaconda. This is true of the command window, but anaconda is obvious. You can type the following in the command window.
pip install tensorflow-gpu
It is your end. It is installed. It's easy, is not it?

If you want to update Tensorflow afterwards, enter the following.
pip install --upgrade tensorflow-gpu
Wow I already have version 0.12.1 updated.

Let's check if the installation is good.

Type python in the command window and hit enter. Enter python.

Then type:
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, Tensorflow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
Hello, Tensorflow!
Hello, Tensorflow! If the output is good, installation is complete.

Next time, I'll look at the slim model and try it out myself.

* Ask a question in a comment.

댓글 없음:

댓글 쓰기

가장 많이 본 글