Skip to content

Running program.populate during training causes loss to be None for PrimalDual #342

@AlexWan0

Description

@AlexWan0

Issue: Using program.populate in the middle of a training iteration results in the loss being None on the next training epoch.

Seems to be because program.populate sets the mode as Mode.POPULATE. The model should set it back on the beginning of training, but PrimalDual program uses self.train(), which only changes the pytorch setting.

Changing line 100 of primaldualprogram.py to self.model.mode(Mode.TRAIN) fixes this.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions