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

Summary not working for model on GPU with multiple inputs #537

Closed
VSJMilewski opened this issue Nov 21, 2019 · 1 comment · Fixed by #543
Closed

Summary not working for model on GPU with multiple inputs #537

VSJMilewski opened this issue Nov 21, 2019 · 1 comment · Fixed by #543
Labels
bug Something isn't working

Comments

@VSJMilewski
Copy link
Contributor

Describe the bug
When you want a summary for a model that requires multiple input parameters for forward, then this doesn't work. You can set self.example_input_array to be a tuple and there is some code for passing this to the forward method. However, if the model is on cuda, it tries to pass to move this input directly to cuda without a check whether it is a tuple or list.

the line with the error is here:
pytorch-lightning/blob/master/pytorch_lightning/root_module/memory.py#L53

example of how it should be checked:
pytorch-lightning/blob/master/pytorch_lightning/root_module/memory.py#L61

To Reproduce
Steps to reproduce the behavior:

  1. create a model that requires multiple inputs in the forward method.
  2. set self.example_input_array to be a tuple
  3. run the model on GPU

Expected behavior
a list with all layers and the input and output shapes of these layers.

Screenshots
image

Desktop (please complete the following information):

  • OS: Linux Mint 19.2
  • Browser chrome
  • Version 8.0.3904.97 (Official Build) (64-bit)
@VSJMilewski VSJMilewski added the bug Something isn't working label Nov 21, 2019
@williamFalcon
Copy link
Contributor

@victormilewski1994 good point. I guess we didn't specifically design the summarizer to take in multiple inputs. Would you be interested in submitting a PR?

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 a pull request may close this issue.

2 participants