Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated TF installation instructions #170

Merged
merged 1 commit into from
Aug 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Release history
will still be returned from the function as normal. (`#153`_)
- A warning will now be raised if activation types are passed to
``Converter.swap_activations`` that aren't actually in the model. (`#168`_)
- Updated TensorFlow installation instruction in documentation. (`#170`_)

**Fixed**

Expand All @@ -56,6 +57,7 @@ Release history
.. _#161: https://github.com/nengo/nengo-dl/pull/161
.. _#164: https://github.com/nengo/nengo-dl/pull/164
.. _#168: https://github.com/nengo/nengo-dl/pull/168
.. _#170: https://github.com/nengo/nengo-dl/pull/170

3.2.0 (April 2, 2020)
---------------------
Expand Down
6 changes: 3 additions & 3 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ perform a developer installation:

Installing TensorFlow
---------------------
Use ``pip install tensorflow`` to install the minimal version of TensorFlow,
or ``pip install tensorflow-gpu`` to include GPU support.
Use ``pip install tensorflow`` to install the latest version of TensorFlow. GPU support
is included in this package as of version 2.1.0.

In order to use TensorFlow with GPU support you will need to install the appropriate
Nvidia drivers and CUDA/cuDNN. The precise steps for accomplishing this will depend
on your system. On Linux the correct Nvidia drivers (as of TensorFlow 2.2.0) can be
installed via ``sudo apt install nvidia-drivers-430``, and on Windows simply using the
installed via ``sudo apt install nvidia-driver-440``, and on Windows simply using the
most up-to-date drivers should work. For CUDA/cuDNN we recommend using
`conda <https://docs.conda.io/projects/conda/en/latest/user-guide/install/>`_ to
simplify the process. ``conda install tensorflow-gpu`` will install TensorFlow as
Expand Down
2 changes: 1 addition & 1 deletion nengo_dl/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class BuildConfig(
Smoothing parameter for `~nengo.LIF` gradient approximation.
cpu_only : bool
True if TensorFlow is only running on the CPU (because that was
specified by the user or because ``tensorflow-gpu`` is not installed).
specified by the user or because GPU support is not available).
rng : `~numpy.random.RandomState`
Seeded random number generator.
training : ``tf.Tensor`` (bool)
Expand Down
7 changes: 4 additions & 3 deletions nengo_dl/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ class Simulator: # pylint: disable=too-many-public-methods
This specifies the computational device on which the simulation will
run. The default is ``None``, which means that operations will be assigned
according to TensorFlow's internal logic (generally speaking, this means that
things will be assigned to the GPU if ``tensorflow-gpu`` is installed,
things will be assigned to the GPU if GPU support is available,
otherwise everything will be assigned to the CPU). The device can be set
manually by passing the `TensorFlow device specification
<https://www.tensorflow.org/api_docs/python/tf/Graph#device>`_ to this
Expand Down Expand Up @@ -469,8 +469,9 @@ def __init__(

if device is None and not utils.tf_gpu_installed:
warnings.warn(
"No GPU support detected. It is recommended that you "
"install tensorflow-gpu (`pip install tensorflow-gpu`)."
"No GPU support detected. See "
"https://www.nengo.ai/nengo-dl/installation.html#installing-tensorflow "
"for instructions on setting up TensorFlow with GPU support."
)
logger.info("Running on CPU")
else:
Expand Down
2 changes: 1 addition & 1 deletion nengo_dl/tests/test_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ def test_model_passing(Simulator, seed):
@pytest.mark.parametrize("device", ["/cpu:0", "/gpu:0", None])
def test_devices(Simulator, device, seed, caplog):
if device == "/gpu:0" and not utils.tf_gpu_installed:
pytest.skip("This test requires tensorflow-gpu")
pytest.skip("This test requires GPU support")

caplog.set_level(logging.INFO)

Expand Down
2 changes: 1 addition & 1 deletion nengo_dl/transform_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(self, ops, signals, config):

if not self.conv.channels_last and config.cpu_only:
# TensorFlow doesn't support channels first on CPU, so if
# tensorflow-gpu isn't installed we need to force channels_last
# GPU support isn't available we need to force channels_last
# TODO: check if this is supported in future versions
warnings.warn(
"TensorFlow does not support convolution with "
Expand Down