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

Update training_tricks.py #3151

Merged
merged 4 commits into from
Aug 26, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pytorch_lightning/trainer/training_tricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ def scale_batch_size(self,
def __scale_batch_dump_params(self):
# Prevent going into infinite loop
self.__dumped_params = {
'auto_lr_find': self.auto_lr_find,
'max_steps': self.max_steps,
'weights_summary': self.weights_summary,
'logger': self.logger,
Expand All @@ -226,6 +227,7 @@ def __scale_batch_dump_params(self):

def __scale_batch_reset_params(self, model, steps_per_trial):
self.auto_scale_batch_size = None # prevent recursion
self.auto_lr_find = False # avoid lr find being called multiple times
self.max_steps = steps_per_trial # take few steps
self.weights_summary = None # not needed before full run
self.logger = DummyLogger()
Expand All @@ -237,6 +239,7 @@ def __scale_batch_reset_params(self, model, steps_per_trial):
self.model = model # required for saving

def __scale_batch_restore_params(self):
self.auto_lr_find = self.__dumped_params['auto_lr_find']
self.max_steps = self.__dumped_params['max_steps']
self.weights_summary = self.__dumped_params['weights_summary']
self.logger = self.__dumped_params['logger']
Expand Down