tensorflow / tensorboard

TensorFlow's Visualization Toolkit
Apache License 2.0
6.69k stars 1.66k forks source link

How to display timeline json files in Tensorboard #3761

Open githubsgi opened 4 years ago

githubsgi commented 4 years ago

Used the tf.profile.with_timeline_output (TF 1.15.2) to generate timeline json files ( using Keras is not an option) . These files are viewable in chrome. However Tensorboard says the following. What needs to be done to make them viewable in TB ?

No profile data was found.
If you have a model running on CPU, GPU, or Google Cloud TPU, you may be able to use the above button to capture a profile.
If you’re a CPU or GPU user, please use the IP address option. You may want to check out the tutorial on how to start a TensorFlow profiler server and profile a Keras model on a GPU.
If you're a TPU user, please use the TPU name option and you may want to check out the tutorial on how to interpreting the profiling results.
If you think profiling is done properly, please see the page of Google Cloud TPU Troubleshooting and FAQ and consider filing an issue on GitHub.

https://stackoverflow.com/questions/tagged/tensorboard

Environment information (required)

No problem with TB - it shows graphs, scalars, etc.

Steps to reproduce (required)

Any plain TF code ( non-Keras)

stephanwlee commented 4 years ago

@qiuminxu could you take a look and/or transfer this bug over to the https://github.com/tensorflow/profiler?

qiuminxu commented 4 years ago

@githubsgi No we don't support visualize TF v1 profiler timeline in TensorBoard profile plugin.

Can you use https://www.tensorflow.org/guide/profiler instead? Besides Keras callback, would you be able to use the programmatic API?

githubsgi commented 4 years ago

Thanks for the clarification that TB would not support TF v1 profiler timeline.

Could not figure out whether the alternative you recommended ( https://www.tensorflow.org/guide/profiler ) works with CPUs, Would it work on CPUs ?

By programmatic API , you are referring to https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/profiler/ProfileOptionBuilder#with_timeline_output or something else ?

qiuminxu commented 4 years ago

Yes, the https://www.tensorflow.org/guide/profiler works with CPUs.

By programmatic API, tf.compat.v2.profiler.experimental.start('logdir') Train the model here tf.compat.v2.profiler.experimental.stop()

Alternatively, tf.compat.v2.profiler.experimental.server.start(6009) and use TensorBoard to capture a profile by specifying localhost:6009 in the service addr.

githubsgi commented 4 years ago

Thanks. Do not see any tf.compat.v2.profiler.experimental.start in https://www.tensorflow.org/versions/r1.15/api_docs/python/tf . See one tf.profiler.experimental.start in https://www.tensorflow.org/api_docs/python/tf/profiler/experimental. However that looks like is for TF 2.2 , not TF 1.15. Same for tf.profiler.experimental.Profile('logdir') - only in TF 2.2 not TF 1.15.