I'm currently looking over the Eager mode in Tensorflow and wanted to know if I can extract the graph to use in Tensorboard. I understand that Tensorflow Eager mode does not really have a graph or session system that the user has to create. However, from my understanding there is one under the hood. Could this hidden Graph and Session be exported to support a visual graph view in Tensorboard? Or do I need to redo my model into a Graph/Session form of execution?
1 Answer
No, by default there is no graph nor sessions in eager executing, which is one of the reasons why it is so appealing. You will need to write code that is compatible with both graph and eager execution to write your net's graph in graph mode if you need to.
Note that even though you can use Tensorboard in eager mode to visualize summaries, good ol' tf.summary.FileWriter is incompatible with eager execution: you need to use tf.contrib.summary.create_file_writer instead (works in graph mode too, so you won't have to change your code).
2 Comments
NateAGeek
I greatly appreciate your response. I will admit, I am relatively new to Tensorflow. If it is not too much of a stretch would you mind helping me maybe create a good example for this question. To give people better insight into how to migrate from Graph/Session models to a Eager approach? I'd be happy to set up a gist with boiler plate code. Thank you, Nate
P-Gn
There are so many ways to use eager execution -- some of them involve not being compatible with graphs. A ressource I like though is the video from A. Passos at the TF dev summit 2018. A good advice he gives is to use Keras to maximize compatibility. I would stick with that advice.