Skip to content

Commit 7a4e0bf

Browse files
author
Vijay Vasudevan
committed
Add a comment to install mentioning cuda and cudnn requirements (tensorflow#1985) (tensorflow#1986)
for PIP installs. (Also cherry-pick anaconda instructions)
1 parent 0e61baf commit 7a4e0bf

File tree

1 file changed

+101
-5
lines changed

1 file changed

+101
-5
lines changed

tensorflow/g3doc/get_started/os_setup.md

Lines changed: 101 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ We support different ways to install TensorFlow:
2020
Python programs on your machine.
2121
* [Virtualenv install](#virtualenv-installation): Install TensorFlow in its own
2222
directory, not impacting any existing Python programs on your machine.
23+
* [Anaconda install](#anaconda-installation): Install TensorFlow in its own
24+
environment for those running the Anaconda Python distribution. Does not
25+
impact existing Python programs on your machine.
2326
* [Docker install](#docker-installation): Run TensorFlow in a Docker container
2427
isolated from all other programs on your machine.
2528

26-
If you are familiar with Pip, Virtualenv, or Docker, please feel free to adapt
29+
If you are familiar with Pip, Virtualenv, Anaconda, or Docker, please feel free to adapt
2730
the instructions to your particular needs. The names of the pip and Docker
2831
images are listed in the corresponding installation sections.
2932

@@ -55,7 +58,8 @@ Install TensorFlow:
5558
# Ubuntu/Linux 64-bit, CPU only:
5659
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl
5760

58-
# Ubuntu/Linux 64-bit, GPU enabled:
61+
# Ubuntu/Linux 64-bit, GPU enabled. Requires CUDA toolkit 7.5 and CuDNN v4. For
62+
# other versions, see "Install from sources" below.
5963
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl
6064

6165
# Mac OS X, CPU only:
@@ -69,7 +73,8 @@ For python3:
6973
# Ubuntu/Linux 64-bit, CPU only:
7074
$ sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp34-cp34m-linux_x86_64.whl
7175

72-
# Ubuntu/Linux 64-bit, GPU enabled:
76+
# Ubuntu/Linux 64-bit, GPU enabled. Requires CUDA toolkit 7.5 and CuDNN v4. For
77+
# other versions, see "Install from sources" below.
7378
$ sudo pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp34-cp34m-linux_x86_64.whl
7479

7580
# Mac OS X, CPU only:
@@ -128,7 +133,8 @@ $ source ~/tensorflow/bin/activate.csh # If using csh
128133
# Ubuntu/Linux 64-bit, CPU only:
129134
(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl
130135

131-
# Ubuntu/Linux 64-bit, GPU enabled:
136+
# Ubuntu/Linux 64-bit, GPU enabled. Requires CUDA toolkit 7.5 and CuDNN v4. For
137+
# other versions, see "Install from sources" below.
132138
(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl
133139

134140
# Mac OS X, CPU only:
@@ -145,7 +151,8 @@ $ source ~/tensorflow/bin/activate.csh # If using csh
145151
# Ubuntu/Linux 64-bit, CPU only:
146152
(tensorflow)$ pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp34-cp34m-linux_x86_64.whl
147153

148-
# Ubuntu/Linux 64-bit, GPU enabled:
154+
# Ubuntu/Linux 64-bit, GPU enabled. Requires CUDA toolkit 7.5 and CuDNN v4. For
155+
# other versions, see "Install from sources" below.
149156
(tensorflow)$ pip3 install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp34-cp34m-linux_x86_64.whl
150157

151158
# Mac OS X, CPU only:
@@ -175,6 +182,95 @@ $ source ~/tensorflow/bin/activate.csh # If using csh.
175182
(tensorflow)$ deactivate
176183
```
177184

185+
## Anaconda environment installation
186+
187+
[Anaconda](https://www.continuum.io/why-anaconda) is a Python distribution that
188+
includes a large number of standard numeric and scientific computing packages.
189+
Anaconda uses a package manager called "conda" that has its own
190+
[environment system](http://conda.pydata.org/docs/using/envs.html) similar to Virtualenv.
191+
192+
As with Virtualenv, conda environments keep the dependencies required by
193+
different Python projects in separate places. The Anaconda environment
194+
installation of TensorFlow will not override pre-existing version of the Python
195+
packages needed by TensorFlow.
196+
197+
* Install Anaconda.
198+
* Create a conda environment.
199+
* Activate the conda environment and install TensorFlow in it.
200+
* After the install you will activate the conda environment each time you
201+
want to use TensorFlow.
202+
203+
Install Anaconda:
204+
205+
Follow the instructions on the [Anaconda download site](https://www.continuum.io/downloads)
206+
207+
Create a conda environment called `tensorflow`:
208+
209+
```bash
210+
# Python 2.7
211+
$ conda create -n tensorflow python=2.7
212+
213+
# Python 3.5
214+
$ conda create -n tensorflow python=3.5
215+
```
216+
217+
Activate the environment and use pip to install TensorFlow inside it.
218+
Use the `--ignore-installed` flag to prevent errors about `easy_install`.
219+
220+
```bash
221+
$ source activate tensorflow
222+
(tensorflow)$ # Your prompt should change
223+
224+
# Ubuntu/Linux 64-bit, CPU only:
225+
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl
226+
227+
# Ubuntu/Linux 64-bit, GPU enabled. Requires CUDA toolkit 7.5 and CuDNN v4. For
228+
# other versions, see "Install from sources" below.
229+
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp27-none-linux_x86_64.whl
230+
231+
# Mac OS X, CPU only:
232+
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0rc0-py2-none-any.whl
233+
```
234+
235+
and again for Python 3:
236+
237+
```bash
238+
$ source activate tensorflow
239+
(tensorflow)$ # Your prompt should change
240+
241+
# Ubuntu/Linux 64-bit, CPU only:
242+
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0rc0-cp34-cp34m-linux_x86_64.whl
243+
244+
# Ubuntu/Linux 64-bit, GPU enabled. Requires CUDA toolkit 7.5 and CuDNN v4. For
245+
# other versions, see "Install from sources" below.
246+
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.8.0rc0-cp34-cp34m-linux_x86_64.whl
247+
248+
# Mac OS X, CPU only:
249+
(tensorflow)$ pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.8.0rc0-py3-none-any.whl
250+
```
251+
252+
With the conda environment activated, you can now
253+
[test your installation](#test-the-tensorflow-installation).
254+
255+
When you are done using TensorFlow, deactivate the environment.
256+
257+
```bash
258+
(tensorflow)$ source deactivate
259+
260+
$ # Your prompt should change back
261+
```
262+
263+
To use TensorFlow later you will have to activate the conda environment again:
264+
265+
```bash
266+
$ source activate tensorflow
267+
(tensorflow)$ # Your prompt should change.
268+
# Run Python programs that use TensorFlow.
269+
...
270+
# When you are done using TensorFlow, deactivate the environment.
271+
(tensorflow)$ source deactivate
272+
```
273+
178274
## Docker installation
179275

180276
[Docker](http://docker.com/) is a system to build self contained versions of a

0 commit comments

Comments
 (0)