This document is dedicated to explain how to run the python script for this tutorial.
Please root to the code/
directory and run the python script as the general form of below:
python [python_code_file.py] --log_dir='absolute/path/to/log_dir'
As an example the code can be executed as follows:
python 1-welcome.py --log_dir='~/log_dir'
The --log_dir
flag is to provide the address which the event files (for visualizing in Tensorboard) will be saved. The flag of --log_dir
is not required because its default value is available in the source code as follows:
tf.app.flags.DEFINE_string(
'log_dir', os.path.dirname(os.path.abspath(__file__)) + '/logs',
'Directory where event logs are written to.')
Since the code is ready-to-go, as long as the TensorFlow can be called in the IDE editor(Pycharm, Spyder,..), the code can be executed successfully.
TensorBoard is the graph visualization tools provided by TensorFlow. Using Google’s words: “The computations you'll use TensorFlow for - like training a massive deep neural network - can be complex and confusing. To make it easier to understand, debug, and optimize TensorFlow programs, we've included a suite of visualization tools called TensorBoard.”
The Tensorboard can be run as follows in the terminal:
tensorboard --logdir="absolute/path/to/log_dir"