Skip to content

Commit

Permalink
TensorFlow: Upstream changes to git.
Browse files Browse the repository at this point in the history
Changes:
- Updates to installation instructions.

Base CL: 107352130
  • Loading branch information
keveman committed Nov 9, 2015
1 parent ad9b3be commit dd0e509
Show file tree
Hide file tree
Showing 9 changed files with 164 additions and 127 deletions.
42 changes: 15 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,45 +24,34 @@ and discussion.**

# Download and Setup

To install TensorFlow using a binary package, see the instructions below. For
more detailed installation instructions, including installing from source, see
To install the CPU version of TensorFlow using a binary package, see the
instructions below. For more detailed installation instructions, including
installing from source, GPU-enabled support, etc., see
[here](tensorflow/g3doc/get_started/os_setup.md).

## Binary Installation

### Ubuntu/Linux
The TensorFlow Python API requires Python 2.7.

Make sure you have [pip](https://pypi.python.org/pypi/pip) installed:
The simplest way to install TensorFlow is using
[pip](https://pypi.python.org/pypi/pip) for both Linux and Mac.

```sh
$ sudo apt-get install python-pip
```
For the GPU-enabled version, or if you encounter installation errors, or for
more detailed installation instructions, see
[here](tensorflow/g3doc/get_started/os_setup.md#detailed_install).

Install TensorFlow:
### Ubuntu/Linux

```sh
```bash
# For CPU-only version
$ sudo pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

# For GPU-enabled version. See detailed install instructions
# for GPU configuration information.
$ sudo pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
$ pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
```

### Mac OS X

Make sure you have [pip](https://pypi.python.org/pypi/pip) installed:

If using `easy_install`:

```sh
$ sudo easy_install pip
```

Install TensorFlow (only CPU binary version is currently available).

```sh
$ sudo pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
```bash
# Only CPU-version is available at the moment.
$ pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
```

### Try your first TensorFlow program
Expand All @@ -83,7 +72,6 @@ Hello, TensorFlow!

```


##For more information

* [TensorFlow website](http://tensorflow.org)
Binary file modified tensorflow/g3doc/extras/tensorflow-whitepaper2015.pdf
Binary file not shown.
183 changes: 111 additions & 72 deletions tensorflow/g3doc/get_started/os_setup.md
Original file line number Diff line number Diff line change
@@ -1,90 +1,33 @@
# Download and Setup <a class="md-anchor" id="AUTOGENERATED-download-and-setup"></a>

You can install TensorFlow using our provided binary packages or from source.

## Binary Installation <a class="md-anchor" id="AUTOGENERATED-binary-installation"></a>

The TensorFlow Python API requires Python 2.7.

### Ubuntu/Linux <a class="md-anchor" id="AUTOGENERATED-ubuntu-linux"></a>

**Note**: All the virtualenv-related instructions are optional, but we recommend
using the virtualenv on any multi-user system.

Make sure you have [pip](https://pypi.python.org/pypi/pip), the python headers,
and (optionally) [virtualenv](https://pypi.python.org/pypi/virtualenv) installed:

```bash
$ sudo apt-get install python-pip python-dev python-virtualenv
```

Set up a new virtualenv environment. To set it up in the
directory `~/tensorflow`, run:

```bash
$ virtualenv --system-site-packages ~/tensorflow
$ cd ~/tensorflow
```

Activate the virtualenv:
The simplest way to install TensorFlow is using
[pip](https://pypi.python.org/pypi/pip) for both Linux and Mac.

```bash
$ source bin/activate # If using bash
$ source bin/activate.csh # If using csh
(tensorflow)$ # Your prompt should change
```
If you encounter installation errors, see [common problems](#common_problems)
for some solutions. To simplify installation, please consider using our
virtualenv-based instructions [here](#virtualenv_install).

Inside the virtualenv, install TensorFlow:
### Ubuntu/Linux <a class="md-anchor" id="AUTOGENERATED-ubuntu-linux"></a>

```bash
# For CPU-only version
(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
$ pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

# For GPU-enabled version (only install this version if you have the CUDA sdk installed)
(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

# When you are done using TensorFlow:
(tensorflow)$ deactivate # Deactivate the virtualenv
$ # Your prompt should change back
$ pip install https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
```

### Mac OS X <a class="md-anchor" id="AUTOGENERATED-mac-os-x"></a>

**Note**: All the virtualenv-related instructions are optional, but we recommend
using the virtualenv on any multi-user system.

Make sure you have [pip](https://pypi.python.org/pypi/pip) and
(optionally) [virtualenv](https://pypi.python.org/pypi/virtualenv) installed:

If using `easy_install`:

```bash
$ sudo easy_install pip # If pip is not already installed
$ sudo pip install --upgrade virtualenv
```

Set up a new virtualenv environment. Assuming you want to set it up in the
directory `~/tensorflow`, run:

```bash
$ virtualenv --system-site-packages ~/tensorflow
$ cd ~/tensorflow
```

Activate the virtualenv:

```bash
$ source bin/activate # If using bash
$ source bin/activate.csh # If using csh
(tensorflow)$ # Your prompt should change
```

Install TensorFlow (only CPU binary version is currently available).

```bash
(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl

# When you are done using TensorFlow:
(tensorflow)$ deactivate # Deactivate the virtualenv
$ # Your prompt should change back
# Only CPU-version is available at the moment.
$ pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
```

## Docker-based installation <a class="md-anchor" id="AUTOGENERATED-docker-based-installation"></a>
Expand Down Expand Up @@ -132,11 +75,10 @@ export CUDA_HOME=/usr/local/cuda

### Run TensorFlow <a class="md-anchor" id="AUTOGENERATED-run-tensorflow"></a>

First, activate the TensorFlow virtualenv, then open a python terminal:
Open a python terminal:

```bash
$ source ~/tensorflow/bin/activate # Assuming the tensorflow virtualenv is ~/tensorflow
(tensorflow)$ python
$ python

>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
Expand Down Expand Up @@ -332,3 +274,100 @@ Validation error: 7.0%
...
...
```

## VirtualEnv-based installation <a class="md-anchor" id="virtualenv_install"></a>

We recommend using [virtualenv](https://pypi.python.org/pypi/virtualenv) to
create an isolated container and install TensorFlow in that container -- it is
optional but makes verifying installation issues easier.

First, install all required tools:

```bash
# On Linux:
$ sudo apt-get install python-pip python-dev python-virtualenv

# On Mac:
$ sudo easy_install pip # If pip is not already installed
$ sudo pip install --upgrade virtualenv
```

Next, set up a new virtualenv environment. To set it up in the
directory `~/tensorflow`, run:

```bash
$ virtualenv --system-site-packages ~/tensorflow
$ cd ~/tensorflow
```

Then activate the virtualenv:

```bash
$ source bin/activate # If using bash
$ source bin/activate.csh # If using csh
(tensorflow)$ # Your prompt should change
```

Inside the virtualenv, install TensorFlow:

```bash
(tensorflow)$ pip install --upgrade <$url_to_binary.whl>
```

You can then run your TensorFlow program like:

```bash
(tensorflow)$ python tensorflow/models/image/mnist/convolutional.py

# When you are done using TensorFlow:
(tensorflow)$ deactivate # Deactivate the virtualenv

$ # Your prompt should change back
```


## Common Problems <a class="md-anchor" id="AUTOGENERATED-common-problems"></a>

### GPU-related issues <a class="md-anchor" id="AUTOGENERATED-gpu-related-issues"></a>

If you encounter the following when trying to run a TensorFlow program:

```python
ImportError: libcudart.so.7.0: cannot open shared object file: No such file or directory
```

Make sure you followed the the GPU installation [instructions](#install_cuda).

### On Linux <a class="md-anchor" id="AUTOGENERATED-on-linux"></a>

If you encounter:

```python
...
"__add__", "__radd__",
^
SyntaxError: invalid syntax
```

Solution: make sure you are using Python 2.7.

### On MacOSX <a class="md-anchor" id="AUTOGENERATED-on-macosx"></a>


If you encounter:

```python
import six.moves.copyreg as copyreg

ImportError: No module named copyreg
```

Solution: TensorFlow depends on protobuf which require six-1.10.0. The
installation on some machines may only have an earlier version of six that was
installed using distutils. Unfortunately, upgrading a distutils installed
project via `pip` is deprecated and may fail. If you having difficulty
upgrading six, we recommend playing around with tensorflow using virtualenv.




22 changes: 11 additions & 11 deletions tensorflow/g3doc/how_tos/index.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Overview <a class="md-anchor" id="AUTOGENERATED-overview"></a>
# Overview


## Variables: Creation, Initializing, Saving, and Restoring <a class="md-anchor" id="AUTOGENERATED-variables--creation--initializing--saving--and-restoring"></a>
## Variables: Creation, Initializing, Saving, and Restoring

TensorFlow Variables are in-memory buffers containing tensors. Learn how to
use them to hold and update model parameters during training.

[View Tutorial](../how_tos/variables/index.md)


## TensorFlow Mechanics 101 <a class="md-anchor" id="AUTOGENERATED-tensorflow-mechanics-101"></a>
## TensorFlow Mechanics 101

A step-by-step walk through of the details of using TensorFlow infrastructure
to train models at scale, using MNIST handwritten digit recognition as a toy
Expand All @@ -18,7 +18,7 @@ example.
[View Tutorial](../tutorials/mnist/tf/index.md)


## TensorBoard: Visualizing Learning <a class="md-anchor" id="AUTOGENERATED-tensorboard--visualizing-learning"></a>
## TensorBoard: Visualizing Learning

TensorBoard is a useful tool for visualizing the training and evaluation of
your model(s). This tutorial describes how to build and run TensorBoard as well
Expand All @@ -28,54 +28,54 @@ TensorBoard uses for display.
[View Tutorial](../how_tos/summaries_and_tensorboard/index.md)


## TensorBoard: Graph Visualization <a class="md-anchor" id="AUTOGENERATED-tensorboard--graph-visualization"></a>
## TensorBoard: Graph Visualization

This tutorial describes how to use the graph visualizer in TensorBoard to help
you understand the dataflow graph and debug it.

[View Tutorial](../how_tos/graph_viz/index.md)


## Reading Data <a class="md-anchor" id="AUTOGENERATED-reading-data"></a>
## Reading Data

This tutorial describes the three main methods of getting data into your
TensorFlow program: Feeding, Reading and Preloading.

[View Tutorial](../how_tos/reading_data/index.md)


## Threading and Queues <a class="md-anchor" id="AUTOGENERATED-threading-and-queues"></a>
## Threading and Queues

This tutorial describes the various constructs implemented by TensorFlow
to facilitate asynchronous and concurrent training.

[View Tutorial](../how_tos/threading_and_queues/index.md)


## Adding a New Op <a class="md-anchor" id="AUTOGENERATED-adding-a-new-op"></a>
## Adding a New Op

TensorFlow already has a large suite of node operations from which you can
compose in your graph, but here are the details of how to add you own custom Op.

[View Tutorial](../how_tos/adding_an_op/index.md)


## Custom Data Readers <a class="md-anchor" id="AUTOGENERATED-custom-data-readers"></a>
## Custom Data Readers

If you have a sizable custom data set, you may want to consider extending
TensorFlow to read your data directly in it's native format. Here's how.

[View Tutorial](../how_tos/new_data_formats/index.md)


## Using GPUs <a class="md-anchor" id="AUTOGENERATED-using-gpus"></a>
## Using GPUs

This tutorial describes how to construct and execute models on GPU(s).

[View Tutorial](../how_tos/using_gpu/index.md)


## Sharing Variables <a class="md-anchor" id="AUTOGENERATED-sharing-variables"></a>
## Sharing Variables

When deploying large models on multiple GPUs, or when unrolling complex LSTMs
or RNNs, it is often necessary to access the same Variable objects from
Expand Down
11 changes: 11 additions & 0 deletions tensorflow/g3doc/navbar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# TensorFlow

* [Home][home]
* [Getting Started](/get_started/index.md)
* [Mechanics](/how_tos/index.md)
* [Tutorials](/tutorials/index.md)
* [Python API](/api_docs/python/index.md)
* [C++ API](/api_docs/cc/index.md)
* [Other Resources](/resources/index.md)

[home]: /index.md
Loading

0 comments on commit dd0e509

Please sign in to comment.