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

fix ONNX model save on GPU #3145

Merged
merged 16 commits into from
Aug 26, 2020
Merged

Conversation

lezwon
Copy link
Contributor

@lezwon lezwon commented Aug 25, 2020

What does this PR do?

Fixes #3144

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 25, 2020 03:36
@codecov
Copy link

codecov bot commented Aug 25, 2020

Codecov Report

Merging #3145 into master will increase coverage by 0%.
The diff coverage is 100%.

@@          Coverage Diff           @@
##           master   #3145   +/-   ##
======================================
  Coverage      90%     90%           
======================================
  Files          84      84           
  Lines        8044    8048    +4     
======================================
+ Hits         7225    7229    +4     
  Misses        819     819           

@Borda Borda added the bug Something isn't working label Aug 25, 2020
@mergify mergify bot requested a review from a team August 25, 2020 07:19
pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
tests/models/test_onnx.py Outdated Show resolved Hide resolved
@mergify mergify bot requested a review from a team August 25, 2020 09:27
@mergify mergify bot requested a review from a team August 25, 2020 10:06
pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
pytorch_lightning/core/lightning.py Outdated Show resolved Hide resolved
tests/models/test_onnx.py Outdated Show resolved Hide resolved
@mergify mergify bot requested a review from a team August 26, 2020 06:25
Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐰

@mergify mergify bot requested a review from a team August 26, 2020 08:47
@Borda Borda requested a review from rohitgr7 August 26, 2020 08:47
@mergify
Copy link
Contributor

mergify bot commented Aug 26, 2020

This pull request is now in conflict... :(

lezwon and others added 12 commits August 26, 2020 16:39
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
lezwon and others added 3 commits August 26, 2020 16:39
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
Copy link
Contributor

@rohitgr7 rohitgr7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@mergify mergify bot merged commit d9ea255 into Lightning-AI:master Aug 26, 2020
@mergify
Copy link
Contributor

mergify bot commented Aug 26, 2020

Great job! =)

model.example_input_array = None
file_path = os.path.join(tmpdir, "model.onnx")
input_sample = np.random.randn(1, 28 * 28)
with pytest.raises(ValueError, match=f'Received `input_sample` of type {type(input_sample)}. Expected type is '
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have test catching the second exception?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope. If it is required then I suggest we should add one for Tensorboard log_graph too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ONNX model does not save on GPU
5 participants