Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add graph to Tensorboard logger #2915

Closed
Borda opened this issue Aug 11, 2020 · 2 comments · Fixed by #3003
Closed

add graph to Tensorboard logger #2915

Borda opened this issue Aug 11, 2020 · 2 comments · Fixed by #3003
Labels
feature Is an improvement or enhancement good first issue Good for newcomers help wanted Open to be worked on

Comments

@Borda
Copy link
Member

Borda commented Aug 11, 2020

🚀 Feature

adding a graph to TB logger as it is shown here
https://www.learnopencv.com/tensorboard-with-pytorch-lightning/
maybe also add histograms...

Motivation

image

@Borda Borda added feature Is an improvement or enhancement help wanted Open to be worked on good first issue Good for newcomers labels Aug 11, 2020
@Fan-Luo
Copy link

Fan-Luo commented Sep 29, 2020

Hi,

I am trying to add the computational graph to tensorboard with
self.logger.experiment.add_graph(TriviaQA(self.args), sampleInput)

but got the error message

File "./.local/lib/python3.6/site-packages/torch/jit/init.py", line 742, in _check_trace
raise TracingCheckError(*diag_info)
torch.jit.TracingCheckError: Tracing failed sanity checks!
ERROR: Graphs differed across invocations!

(~30000 lines after Graph diff)

First diverging operator:
Node diff:
- %9 : torch.torch.nn.modules.linear.___torch_mangle_226.Linear = prim::GetAttrname="linear_sp_sent"
? ^^^
+ %9 : torch.torch.nn.modules.linear.___torch_mangle_470.Linear = prim::GetAttrname="linear_sp_sent"
? ^^^

I tried one solution in the similar issue (pytorch/pytorch#23993) by not declare sampleInput as a variable, but does not work.
The other solution mentioned is to set check_trace to False. But I do not call torch.jit.trace directly.

Another issue (#3003) mentioned one requirement: user has defined the model.example_input_array attribute, but I assume it is only for automatically logging the computational graph, right?

Any other solution I can try?

Thank you

@JakobHavtorn
Copy link

It would be nice to be able to pipe arguments for torch.jit.trace through .add_graph() as kwargs such that we can disable the trace checking for stochastic models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement good first issue Good for newcomers help wanted Open to be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants