Visualizing the graph

I am using tensorboard to monitor metrics/losses and it works smoothly. However, I would also like to see the graph (as explained here in the TF documentation). This option does not seem to be used in onmt, because when I go the the graph page in tensorboard, it tells me No graph definition files were found. I went through this forum, GitHub issues, and the parameter page, but could not find any indication of how to get the graph. If this is not possible in onmt to get the graph in tensorboard, I would also be happy with having just a text-based visualization of the model (as one can get in PyTorch when print'ing the model).

Hi, I use it regularly. You start Tensorboard in the same environment as TF and ONMT. You point logdir to your model directory. If you want to view on the same machine the graph will be at localhost port 6006 unless you specify somewhere else.

Thanks for your reply. I know how to show the logs of the metrics and losses and such, but I am interested in seeing a representation of the model. This can be done with tensorboard’s graph utility which visualizes the tensorflow graph. You can see an example in the middle of this page.

As mentioned in the page you linked, there are specific steps to export a graph that TensorBoard can consume. I will look to make it work in the next version.


I tried the TensorBoard visualization but it becomes very slow on large graphs and shows a lot of uninteresting details.

I might end up dumping a PyTorch-style description in the logs. This will also help debugging user issues.

It doesn’t have to be in Tensorboard, indeed. I would already be satisfied with a PyTorch-style view (perhaps by setting the base model’s __repr__?).

Yep, I just added that, using the same format (and logic?) as PyTorch:

Good stuff! Will give it a go when I find the time. Thanks