mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-06 16:50:09 +08:00
removed from_lightning flag
This commit is contained in:
@@ -461,7 +461,7 @@ class Trainer(TrainerIO):
|
||||
self.batch_loss_value = 0 # accumulated grads
|
||||
|
||||
# init progbar when requested
|
||||
if self.progress_bar :
|
||||
if self.progress_bar:
|
||||
self.prog_bar = tqdm.tqdm(range(self.total_batches), position=self.process_position)
|
||||
|
||||
for batch_nb, data_batch in enumerate(self.tng_dataloader):
|
||||
@@ -595,6 +595,7 @@ class Trainer(TrainerIO):
|
||||
|
||||
# backward pass
|
||||
if self.use_amp:
|
||||
# scale loss when using amp
|
||||
for optimizer in self.optimizers:
|
||||
with amp.scale_loss(loss, optimizer) as scaled_loss:
|
||||
scaled_loss.backward()
|
||||
|
||||
Reference in New Issue
Block a user