Setting Up Tensorflow (with CUDA) for Windows 10
Below are some of my rough notes on how I've setup my Windows 10 laptop to use Tensorflow with CUDA.
My reference:
- http://www.heatonresearch.com/2017/01/01/tensorflow-windows-gpu.html
- https://www.tensorflow.org/install/
- CUDA Drivers (http://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows). Currently it's CUDA Toolkit 8.0. Can install using the installer downloaded.
- CUDNN - CUDA for Deep Neural Networks (https://developer.nvidia.com/cudnn). Currently it's 5.1. Once extracted, place the files in the respective directory along with the other CUDA files in the NVIDIA Toolkit folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conda create --name tensorflow python=3.5 | |
activate tensorflow | |
conda install jupyter (this might fail due to :PaddingError: Placeholder of length '30' too short in package qt-5.6.2-vc14_0.% The package must be rebuilt with conda-build > 2.0. Try running 'conda update --all' in root env, and running it again) | |
conda install scipy | |
pip install tensorflow |
Setting up Tensorflow (GPU)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conda create --name tensorflow-gpu python=3.5 | |
activate tensorflow-gpu | |
conda install jupyter | |
conda install scipy | |
pip install tensorflow-gpu |
Note: It's 22/2/2017 now and Google have recently released their Tensorflow 1.0, which might've rendered the above guide obsolote (i've haven't tested them yet).
Update (23/2/2017):
The above basically creates 2 new anaconda instance for you to play with. I like this approach since it's cleaner and does not mess up my original Anaconda installation - easier to troubleshoot (and destroy if need be). To select the instance that you wish to run, and run jupyter - you may use the following steps:
And your Jupyter should've already loaded by now.
The above basically creates 2 new anaconda instance for you to play with. I like this approach since it's cleaner and does not mess up my original Anaconda installation - easier to troubleshoot (and destroy if need be). To select the instance that you wish to run, and run jupyter - you may use the following steps:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Users\UserName>activate tensorflow-gpu | |
(tensorflow-gpu) C:\Users\UserName>jupyter | |
usage: jupyter-script.py [-h] [--version] [--config-dir] [--data-dir] | |
[--runtime-dir] [--paths] [--json] | |
[subcommand] | |
jupyter-script.py: error: one of the arguments --version subcommand --config-dir --data-dir --runtime-dir --paths is required | |
(tensorflow-gpu) C:\Users\UserName>jupyter notebook | |
[I 01:02:35.990 NotebookApp] [nb_conda_kernels] enabled, 4 kernels found | |
[I 01:02:41.129 NotebookApp] [nb_anacondacloud] enabled | |
[I 01:02:41.176 NotebookApp] [nb_conda] enabled | |
[I 01:02:42.015 NotebookApp] \u2713 nbpresent HTML export ENABLED | |
[W 01:02:42.015 NotebookApp] \u2717 nbpresent PDF export DISABLED: No module named 'nbbrowserpdf' | |
[I 01:02:42.147 NotebookApp] Serving notebooks from local directory: c:/Hafidz/Playground/ | |
[I 01:02:42.147 NotebookApp] 0 active kernels | |
[I 01:02:42.147 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=38564ad6bc871a295d6f9f0ddcbb6c2e9a459ff9cf8860fb | |
[I 01:02:42.147 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). | |
[C 01:02:42.162 NotebookApp] | |
Copy/paste this URL into your browser when you connect for the first time, | |
to login with a token: | |
http://localhost:8888/?token=38564ad6bc871a295d6f9f0ddcbb6c2e9a459ff9cf8860fb | |
[I 01:02:42.581 NotebookApp] Accepting one-time-token-authenticated connection from ::1 |