Last active
May 4, 2018 16:48
-
-
Save ravi9/50c3d7e67de56759c3795460cb2b2059 to your computer and use it in GitHub Desktop.
Simple mnist example for using keras to save tracing info with TF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Install requirements. | |
pip install virtualenv | |
virtualenv --python=/usr/bin/python2.7 keras_tracing | |
source keras_tracing/bin/activate | |
cd keras_tracing/ | |
pip install keras | |
pip install -i https://pypi.anaconda.org/intel/simple tensorflow | |
#Clone mnist sample code | |
git clone https://github.com/ravi9/keras-trace-example.git | |
cd keras-trace-example | |
#Train a MNIST model | |
python mnist_train.py | |
#Run inference, model.predict() and save timeline tracing info | |
python mnist_inference.py | |
#The above command will save Tensorflow trace to: ./timeline_trace.json | |
#To view the trace: | |
#(1) Open Chrome browser. | |
#(2) Go to this url -- chrome://tracing | |
#(3) Click the load button. | |
#(4) Load the file ./timeline_trace.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment