Troubleshoot writer.add_graph

Hi All,
I have a model that I am converting from the original (produced by others in TFv1) to Torch.

I’m trying to use tensorboard renditions of computational graphs to compare to the original and Torch model. However, when I use the .add_graph() function as below:

writer.add_graph(sindy_autoencoder, torch_stacked_validation_data)

I get an error:

{RuntimeError}Encountering a dict at the output of the tracer might cause the trace to be incorrect, this is only valid if the container structure does not change based on the modules inputs. Consider using a constant container instead (e.g. for list, use tuple instead. for dict, use a NamedTuple instead). If you absolutely need this and know the side effect, pass strict=False to trace() to allow this behaviour.

I pass a torch.tensor in so I’m not sure what this means.

Can anyone advise on a possible resolution?


You might want to open an issue to pytorch with a reproducable script.