Make Sense of Deep Neural Networks using TensorBoard
May 4, 2017 ยท View on GitHub
Getting Started
Note: Notebooks in this repo are written in Python 3 and use TensorFlow (version 1.x). You'll need Jupyter/iPython to run them.
Local installation
Fetch the repo: github.com/PythonWorkshop/tensorboard_demos
git clone git@github.com:PythonWorkshop/tensorboard_demos
cd tensorboard_demos/
Then, choose one of the options below: Conda (if you have Anaconda and conda-env installed), otherwise pip.
Option A: Conda install
- Create a conda environment (auto-installs packages as per
environment.yml) and activate it:
conda env create
source activate tensorflow
- Run notebook:
jupyter notebook tensorboard_basics.ipynb
For troubleshooting, see TensorFlow's Anaconda installation instructions.
Option B: Pip install
- Install dependencies first (NumPy, matplotlib, scikit-learn):
pip3 install numpy matplotlib scikit-learn
-
Install TensorFlow as per instructions for your platform.
-
Run notebook:
jupyter notebook tensorboard_basics.ipynb
Binder
If you have trouble getting TensorFlow to work, hit the launch binder badge to run in the cloud. Note that this is an experimental feature.
Running TensorBoard
Follow the notebook to build a neural network and train it. During training, make sure events are logged using tf.summary.FileWriter (code included in demo). Then run TensorBoard, pointing it to the log directory:
tensorboard --logdir=logs
And then open the URL that gets printed, in your browser (typically: http://0.0.0.0:6006).
Explore the structure of the neural network in the Graph tab, and the summaries you reported in the Events tab.