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

Multiple optimizers support in training_epoch_end #1397

Closed
quinor opened this issue Apr 6, 2020 · 4 comments
Closed

Multiple optimizers support in training_epoch_end #1397

quinor opened this issue Apr 6, 2020 · 4 comments
Labels
design Includes a design discussion discussion In a discussion stage good first issue Good for newcomers help wanted Open to be worked on won't fix This will not be worked on

Comments

@quinor
Copy link
Contributor

quinor commented Apr 6, 2020

🐛 Bug

training_epoch_end only gets the return values from training_step called for the last optimizer each batch.

See:
https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pytorch_lightning/trainer/training_loop.py#L603
https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pytorch_lightning/trainer/training_loop.py#L657

To Reproduce

Create a LightningModule with two optimizers. Try to access both training_step return values in the training_epoch_end.

Code sample

(trivial)

Expected behavior

I'd like to have access to both as ie. a list of tuples or a tuple of lists. I'd probably prefer a tuple of lists, ie. I get a separate list of return values for each of the optimizers.

Environment

cuda:
        GPU:
                GeForce GTX 1080 Ti
        available:           True
        version:             10.1
packages:
        numpy:               1.18.2
        pyTorch_debug:       False
        pyTorch_version:     1.4.0
        pytorch-lightning:   0.7.2-dev
        tensorboard:         2.2.0
        tqdm:                4.43.0
system:
        OS:                  Linux
        architecture:
                64bit
                ELF
        processor:           
        python:              3.8.2
        version:             #1 SMP PREEMPT Sun, 22 Mar 2020 16:33:15 +0000

Additional context

@quinor quinor added bug Something isn't working help wanted Open to be worked on labels Apr 6, 2020
@Borda Borda added this to the 0.7.2 milestone Apr 7, 2020
@Borda
Copy link
Member

Borda commented Apr 7, 2020

@asafmanor pls may you check it?

@Borda Borda modified the milestones: 0.7.2, 0.7.3 Apr 8, 2020
@Borda Borda modified the milestones: 0.7.4, 0.7.5 Apr 26, 2020
@Borda Borda modified the milestones: 0.7.6, 0.8.0, 0.7.7 May 12, 2020
@Borda Borda modified the milestones: 0.7.7, 0.8.0 May 26, 2020
@Borda Borda modified the milestones: 0.8.0, 0.9.0 Jun 9, 2020
@williamFalcon williamFalcon self-assigned this Jun 26, 2020
@williamFalcon williamFalcon added the priority: 0 High priority task label Jun 26, 2020
@awaelchli
Copy link
Contributor

@williamFalcon should we support this?

@edenlightning edenlightning modified the milestones: 0.9.0, 0.9.x Aug 20, 2020
@edenlightning edenlightning added design Includes a design discussion discussion In a discussion stage and removed priority: 0 High priority task bug Something isn't working labels Sep 16, 2020
@edenlightning edenlightning modified the milestones: 0.9.x, 1.1 Sep 30, 2020
@stale
Copy link

stale bot commented Oct 31, 2020

This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team!

@stale stale bot added the won't fix This will not be worked on label Oct 31, 2020
@awaelchli awaelchli removed the won't fix This will not be worked on label Oct 31, 2020
@awaelchli awaelchli added the good first issue Good for newcomers label Oct 31, 2020
@edenlightning edenlightning modified the milestones: 1.1, 1.2.x, 1.2 Nov 30, 2020
@edenlightning edenlightning modified the milestones: 1.2, 1.3 Feb 8, 2021
@edenlightning edenlightning removed this from the 1.3 milestone Feb 22, 2021
@stale
Copy link

stale bot commented Mar 25, 2021

This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team!

@stale stale bot added the won't fix This will not be worked on label Mar 25, 2021
@stale stale bot closed this as completed Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Includes a design discussion discussion In a discussion stage good first issue Good for newcomers help wanted Open to be worked on won't fix This will not be worked on
Projects
None yet
Development

No branches or pull requests

5 participants