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

Trainer typo + no grad_fn #89

Open
avaughan0 opened this issue Jul 2, 2023 · 2 comments
Open

Trainer typo + no grad_fn #89

avaughan0 opened this issue Jul 2, 2023 · 2 comments

Comments

@avaughan0
Copy link

Describe the bug

  1. trainer() class contains keyword arguments that no longer exist in Pytorch Lightning Trainer class (such as gpus).
  2. Even when these errors are corrected, attempting to train the model causes the following error: (TPU) Exception in device=TPU:6: element 0 of tensors does not require grad and does not have a grad_fn (GPU) Runtime Error: element 0 of tensors does not require grad and does not have a grad_fn

To Reproduce
Steps to reproduce the behavior:
Try to train the model.

Expected behavior
To train the model :)

@rajkumarjayaprakash97
Copy link

Is there any possible fix @avaughan0 ? Any idea whether the issue is? like in DataModule or do we need to change optimizer?

@avaughan0
Copy link
Author

@rajkumarjayaprakash97 the trainer class issues are easily fixed by simply removing the deprecated keyword arguments from the class (it's toward the end). But I have no idea how to fix the grad_fn problem. Based on my research, it seems to have something to do with the way loss is handled in the LightningModel class (based on LightningModule) but I honestly don't know what is wrong or how to fix it. I tried variations of torch.no_grad but that didn't help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants