Implement/document TB debugging with tf.keras model.fit
See original GitHub issueCurrently (in TF 2.0.0 and TF 2.1.0 and tf-nightly
/tb-nightly
) the /#debugger
view shows this snippet for “Keras Model”:
import tensorflow as tf
from tensorflow.python import debug as tf_debug
import keras
keras.backend.set_session(
tf_debug.TensorBoardDebugWrapperSession(tf.Session(), "ip-a-b-c-d:6064"))
# Define your keras model, called "model".
model.fit(...)
But I’m using tf.keras
. So I tried the above with from tensorflow import keras
instead of import keras
, and that fails (in TF 2.0.0 and TF 2.1.0 and tf-nightly
) with:
AttributeError: module 'tensorflow.python.keras.api._v2.keras.backend' has no attribute 'set_session'
Looks like set_session
was marked compat.v1
already in Tensorflow 2.0.0: https://github.com/tensorflow/tensorflow/commit/86ac0d0a377d5b89a97c9c468a31b6506c9a7209
So I didn’t find any instructions anywhere for using the Tensorboard debugger view with a tf.keras model.fit scenario in Tensorflow 2.0.0 up.
Is that not implemented at all, or the setup just not documented?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
Keras debugging tips
If you write a custom layer, don't call fit() on your entire model just yet. Call your layer on some test data first....
Read more >Debugging in TensorFlow - Towards Data Science
When you train with tf.keras.model.fit, by default, the training step is executed in graph mode. Of course, the inability to access arbitrary ...
Read more >Inside TensorFlow: TF Debugging - YouTube
In this episode of Inside TensorFlow, Software Engineer Shanqing Cai demonstrates to us TensorFlow Debugging for TF 2 and TF 1.
Read more >Logging with Tensorboard — DIVEDEEP - CityU CS
To call additional functions during training, we can add the functions to the callbacks parameter of the model fit method. For instance: import...
Read more >tf.keras.Model | TensorFlow v2.11.0
Your model might run slower, but it should become easier for you to debug it by stepping into individual layer calls. By default,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I too see similar (bogus) behavior as @gthb describes, usingTensorFlow version: 2.1.0
I’m facing the same issue in TF/2.2.0. Tensorflow doesn’t even try to connect to Tensorboard debugger plugin.