From f9c74a1698bdacd4eb4c94f6a37124bdeaff11ab Mon Sep 17 00:00:00 2001 From: William Hosford Date: Sun, 25 Mar 2018 14:19:33 -0700 Subject: [PATCH] Update tensorflow readme with distributed mode instructions --- tensorflow-notebook/README.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/tensorflow-notebook/README.md b/tensorflow-notebook/README.md index 7d448e41..ad53b2b2 100644 --- a/tensorflow-notebook/README.md +++ b/tensorflow-notebook/README.md @@ -17,9 +17,11 @@ docker run -it --rm -p 8888:8888 jupyter/tensorflow-notebook Take note of the authentication token included in the notebook startup log messages. Include it in the URL you visit to access the Notebook server or enter it in the Notebook login form. -## Tensorflow Single Machine Mode +## Tensorflow Machine Mode -As distributed tensorflow is still immature, we currently only provide the single machine mode. +Tensorflow can use single machine, or distributed mode. + +Single machine mode: ``` import tensorflow as tf @@ -33,6 +35,21 @@ sess.run(init) sess.run(hello) ``` +Distributed mode: + +``` +import tensorflow as tf + +hello = tf.Variable('Hello Distributed World!') + +server = tf.train.Server.create_local_server() +sess = tf.Session(server.target) +init = tf.global_variables_initializer() + +sess.run(init) +sess.run(hello) +``` + ## Notebook Options The Docker container executes a [`start-notebook.sh` script](../base-notebook/start-notebook.sh) script by default. The `start-notebook.sh` script handles the `NB_UID`, `NB_GID` and `GRANT_SUDO` features documented in the next section, and then executes the `jupyter notebook`. @@ -99,7 +116,7 @@ For additional information about using SSL, see the following: ## Conda Environments -The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. +The default Python 3.x [Conda environment](http://conda.pydata.org/docs/using/envs.html) resides in `/opt/conda`. The commands `jupyter`, `ipython`, `python`, `pip`, and `conda` (among others) are available in both environments. For convenience, you can install packages into either environment regardless of what environment is currently active using commands like the following: