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

Feature/log computational graph #3003

Merged

Conversation

SkafteNicki
Copy link
Member

What does this PR do?

Fixes #2915
Automatically logs the computational graph for certain loggers (tensorboard and test tube, could not find any other loggers that is able to do this). Only requirement is that user has defined the model.example_input_array attribute which we already use for model summaries.

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together? Otherwise, we ask you to create a separate PR for every change.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@mergify mergify bot requested a review from a team August 16, 2020 14:00
@SkafteNicki SkafteNicki changed the title Feature/computational graph Feature/log computational graph Aug 16, 2020
@codecov
Copy link

codecov bot commented Aug 17, 2020

Codecov Report

Merging #3003 into master will decrease coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #3003   +/-   ##
======================================
- Coverage      90%     90%   -0%     
======================================
  Files          81      81           
  Lines        7626    7694   +68     
======================================
+ Hits         6860    6908   +48     
- Misses        766     786   +20     

tests/models/test_cpu.py Outdated Show resolved Hide resolved
pytorch_lightning/loggers/base.py Outdated Show resolved Hide resolved
@mergify mergify bot requested a review from a team August 17, 2020 12:46
@Borda Borda added the feature Is an improvement or enhancement label Aug 17, 2020
@williamFalcon williamFalcon merged commit cefc7f7 into Lightning-AI:master Aug 19, 2020
@SkafteNicki SkafteNicki deleted the feature/computational_graph branch August 20, 2020 09:22
@Borda Borda added this to the 0.9.0 milestone Aug 20, 2020
@rohitgr7
Copy link
Contributor

@SkafteNicki should we disable log_graph when logger=True, or set log_graph=False by default?
https://github.com/PyTorchLightning/pytorch-lightning/blob/bcdb750976ca2a62925fdf5201720d6b383db37e/pytorch_lightning/trainer/logging.py#L44-L50
I think it should be totally optional because it gives the model.example_input_array attribute is not set or input_array warning and not every time one wants to log the graph.

@SkafteNicki
Copy link
Member Author

@rohitgr7 I am fine by not logging the graph as default. I just though that automatically adding the graph would be a nice default behavior (if exanple_input_array is defined) for people just using the default logger. But if the warning is annoying we can definitely change this.

@rohitgr7
Copy link
Contributor

yeah, the warning is a bit annoying. will change to False by default :)

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add graph to Tensorboard logger
5 participants