From e052a3bc92885838a53721d97825588be4861964 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Thu, 16 May 2019 15:52:00 -0400 Subject: [PATCH] added amp level option --- pytorch_lightning/models/trainer.py | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pytorch_lightning/models/trainer.py b/pytorch_lightning/models/trainer.py index 7d94f6363c..d360d7ac2d 100644 --- a/pytorch_lightning/models/trainer.py +++ b/pytorch_lightning/models/trainer.py @@ -372,7 +372,8 @@ class Trainer(TrainerIO): if self.use_amp: for optimizer in self.optimizers: with amp.scale_loss(loss, optimizer) as scaled_loss: - scaled_loss.backward() + optimizer.backward(scaled_loss) + # scaled_loss.backward() else: loss.backward() diff --git a/setup.py b/setup.py index bb555b009f..d19bfed408 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from setuptools import setup, find_packages # http://blog.ionelmc.ro/2014/05/25/python-packaging/ setup( name="pytorch-lightning", - version='0.1.dev1826', + version='0.1.dev1827', description="The Keras for ML researchers using PyTorch", author="William Falcon", author_email="waf2107@columbia.edu",