Search code examples
tensorflow2.0tf.keraswandb

What does "save_graph" keyword in WandbCallback mean?


I'm using Weights and Biases to track my deep learning models. To monitor everything I use the WandbCallback in .fit. In the WandbCallback documentation there is the keyword save_graph which defaults to True. The description is very brief and I wondered what that saved graph is and what it's for? Is saving a graph a costly operation? For what is it needed? (like does it complement something else, like saving the best model?)


Solution

  • That is used to create log a wandb.Graph of the model. This class is typically used for saving and diplaying neural net models. It represents the graph as an array of nodes and edges. The nodes can have labels that can be visualized by wandb. Here's an example of the graph that it produces: https://wandb.ai/l2k2/keras-examples/runs/ieqy2e9h/model

    Here's the code that does that within the callback. https://github.com/wandb/client/blob/1609f82c84e2244ed8fe62c746099d2094bd746a/wandb/integration/keras/keras.py#L552