Sei sulla pagina 1di 6

Tensorflow Installation

Thursday, October 5, 2017 10:53 AM

1. First Install the VC_Redist x64 file


2. Next Install the CUDA v8.x.x for windows (the 1.2 gb file) while installation ignore any warnings
and proceed normally.
3. Next Extract the CuDnn 8-0 windwos v 6.0 in a folder
4. Go inside the folder and find three folders:

5.

6. Now copy these and head over to this folder: C:\Program Files\NVIDIA GPU Computing Toolkit
\CUDA\v8.0 (the installation location of CUDA on your PC)
7. Paste the folders in here. If it asks for permission allow.

8.

9. Afterwards go to search menu and type in Environment variables. Otherwise from Control panel>
System and Security > System > Advanced System Settings Open this dialog Box:

10.

SP Cup 2018 Page 1


System and Security > System > Advanced System Settings Open this dialog Box:

10.

11. From the Advanced Tab Select Environment Variables which will open this Dialog Box:

12.

13. Select Path from user variables and click on edit and ensure that these four Paths exist. Otherwise

SP Cup 2018 Page 2


13. Select Path from user variables and click on edit and ensure that these four Paths exist. Otherwise
Click on New and add these paths (these are actually the paths to the three items that we copied:
cudnn64_6.dll, cuddn.h and cudnn.lib. You could also copy and paste the addresses of these file
locations here in this form which would avoid path error)

14.

15. Click OK and return to the previous dialog box. Here check that these three paths exist. If not, add
the paths by clicking New with appropriate Variable name and value. Now when they do, you are
good to go!

SP Cup 2018 Page 3


16.

17. Now open up cmd and type in the following:


conda create -n tensorflow-gpu python=3.5
You can give it any name according to your will. Accept the promtps and a separate conda
environment will be created.

18.

19. Now activate your environment by typing activate tensorflow-gpu


in order to deactivate your environment type deactivate tensorflow-gpu
20. Head into the environment and type in pip install tensorflow-gpu
wait for a while and tensorflow should be installed.

21.

22. Now to check your tensorflow installation type python in your command shell and open up
python
23. Next type import tensorflow as tf
and if it shows no error then again type in tf.Session()
24. If this works it will show you some details about your hardware and installation. If no errors occur
in the process it means that you are good to go.

SP Cup 2018 Page 4


25.

26. Next to install keras head back to the terminal by typing exit() in the python shell. Type in the
following command: conda -c conda-forge keras and proceed. Keras should shortly be installed.

27.

28. Now in order to check that your keras installation is working properly type in python again and
then type in import keras if it shows the following, keras and tensorflow are good to go for you!

29.

30. A bad thing the tensorflow installation does is that it Tampers with the html5lib of your conda
environment and you will have later issues installing any pip packages. So in order to fix this
extract the html5lib-python-master archive and copy the html5lib folder to the following location
according to your PC.

31.

32. In my case the location was: C:\Users\Suhail\Anaconda3\envs\tensorflow-gpu\Lib\site-packages


overwrite the existing html5lib folder when it asks for permission. This should fix your html5lib
library.

SP Cup 2018 Page 5


library.

33.

SP Cup 2018 Page 6

Potrebbero piacerti anche