Skip to content

Latest commit

 

History

History
60 lines (32 loc) · 1.87 KB

File metadata and controls

60 lines (32 loc) · 1.87 KB

Welcome to TensorFlow World

This document is dedicated to explain how to run the python script for this tutorial.

How to run the code in Terminal?

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.')

How to run the code in IDEs?

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.

How to run the Tensorboard?

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"