diff --git a/docs/tutorials/advanced_topics/howto_pytorch_lightning.md.template b/docs/tutorials/advanced_topics/howto_pytorch_lightning.md.template index 4d54d5636a..01e170951e 100644 --- a/docs/tutorials/advanced_topics/howto_pytorch_lightning.md.template +++ b/docs/tutorials/advanced_topics/howto_pytorch_lightning.md.template @@ -134,7 +134,7 @@ To train the model using PyTorch Lightning, we only need to extend the class wit ```python -import lightning.pytorch as pl +import pytorch_lightning as pl ``` diff --git a/requirements/requirements-pytorch.txt b/requirements/requirements-pytorch.txt index 03f4e997ab..dd7efffd35 100644 --- a/requirements/requirements-pytorch.txt +++ b/requirements/requirements-pytorch.txt @@ -1,6 +1,4 @@ torch>=1.9,<3 -lightning>=1.8,<2.2 -# Capping `lightning` does not cap `pytorch_lightning`, so we cap manually pytorch_lightning>=1.8,<2.2 # Need to pin protobuf (for now) # See: https://github.com/PyTorchLightning/pytorch-lightning/issues/13159 diff --git a/src/gluonts/torch/model/d_linear/estimator.py b/src/gluonts/torch/model/d_linear/estimator.py index e3f428db86..4f58caf4a0 100644 --- a/src/gluonts/torch/model/d_linear/estimator.py +++ b/src/gluonts/torch/model/d_linear/estimator.py @@ -14,7 +14,7 @@ from typing import Optional, Iterable, Dict, Any import torch -import lightning.pytorch as pl +import pytorch_lightning as pl from gluonts.core.component import validated from gluonts.dataset.common import Dataset diff --git a/src/gluonts/torch/model/d_linear/lightning_module.py b/src/gluonts/torch/model/d_linear/lightning_module.py index bd081b45dd..28dccf1b97 100644 --- a/src/gluonts/torch/model/d_linear/lightning_module.py +++ b/src/gluonts/torch/model/d_linear/lightning_module.py @@ -11,7 +11,7 @@ # express or implied. See the License for the specific language governing # permissions and limitations under the License. -import lightning.pytorch as pl +import pytorch_lightning as pl import torch from gluonts.core.component import validated diff --git a/src/gluonts/torch/model/deepar/lightning_module.py b/src/gluonts/torch/model/deepar/lightning_module.py index 8d190e2329..fc676dfab3 100644 --- a/src/gluonts/torch/model/deepar/lightning_module.py +++ b/src/gluonts/torch/model/deepar/lightning_module.py @@ -11,7 +11,7 @@ # express or implied. See the License for the specific language governing # permissions and limitations under the License. -import lightning.pytorch as pl +import pytorch_lightning as pl import torch from torch.optim.lr_scheduler import ReduceLROnPlateau diff --git a/src/gluonts/torch/model/estimator.py b/src/gluonts/torch/model/estimator.py index 9f41282ebb..a6ed739458 100644 --- a/src/gluonts/torch/model/estimator.py +++ b/src/gluonts/torch/model/estimator.py @@ -15,7 +15,7 @@ import logging import numpy as np -import lightning.pytorch as pl +import pytorch_lightning as pl import torch.nn as nn from gluonts.core.component import validated diff --git a/src/gluonts/torch/model/lag_tst/estimator.py b/src/gluonts/torch/model/lag_tst/estimator.py index c3ae48237a..27bfd253b2 100644 --- a/src/gluonts/torch/model/lag_tst/estimator.py +++ b/src/gluonts/torch/model/lag_tst/estimator.py @@ -14,7 +14,7 @@ from typing import Optional, Iterable, Dict, Any, List import torch -import lightning.pytorch as pl +import pytorch_lightning as pl from gluonts.core.component import validated from gluonts.dataset.common import Dataset diff --git a/src/gluonts/torch/model/lag_tst/lightning_module.py b/src/gluonts/torch/model/lag_tst/lightning_module.py index 5c9e70e9e4..2510944cfa 100644 --- a/src/gluonts/torch/model/lag_tst/lightning_module.py +++ b/src/gluonts/torch/model/lag_tst/lightning_module.py @@ -11,7 +11,7 @@ # express or implied. See the License for the specific language governing # permissions and limitations under the License. -import lightning.pytorch as pl +import pytorch_lightning as pl import torch from gluonts.core.component import validated diff --git a/src/gluonts/torch/model/lightning_util.py b/src/gluonts/torch/model/lightning_util.py index 73e2396140..6742c8c7cf 100644 --- a/src/gluonts/torch/model/lightning_util.py +++ b/src/gluonts/torch/model/lightning_util.py @@ -13,7 +13,7 @@ from packaging import version -import lightning.pytorch as pl +import pytorch_lightning as pl def has_validation_loop(trainer: pl.Trainer): diff --git a/src/gluonts/torch/model/mqf2/lightning_module.py b/src/gluonts/torch/model/mqf2/lightning_module.py index 16916c3c41..6dc824beb4 100644 --- a/src/gluonts/torch/model/mqf2/lightning_module.py +++ b/src/gluonts/torch/model/mqf2/lightning_module.py @@ -13,7 +13,7 @@ from typing import Dict -import lightning.pytorch as pl +import pytorch_lightning as pl import torch from torch.optim.lr_scheduler import ReduceLROnPlateau diff --git a/src/gluonts/torch/model/patch_tst/estimator.py b/src/gluonts/torch/model/patch_tst/estimator.py index 860c18e193..c84576916f 100644 --- a/src/gluonts/torch/model/patch_tst/estimator.py +++ b/src/gluonts/torch/model/patch_tst/estimator.py @@ -14,7 +14,7 @@ from typing import Optional, Iterable, Dict, Any import torch -import lightning.pytorch as pl +import pytorch_lightning as pl from gluonts.core.component import validated from gluonts.dataset.common import Dataset diff --git a/src/gluonts/torch/model/patch_tst/lightning_module.py b/src/gluonts/torch/model/patch_tst/lightning_module.py index d80137ae05..f5e95158b2 100644 --- a/src/gluonts/torch/model/patch_tst/lightning_module.py +++ b/src/gluonts/torch/model/patch_tst/lightning_module.py @@ -11,7 +11,7 @@ # express or implied. See the License for the specific language governing # permissions and limitations under the License. -import lightning.pytorch as pl +import pytorch_lightning as pl import torch from gluonts.core.component import validated diff --git a/src/gluonts/torch/model/simple_feedforward/estimator.py b/src/gluonts/torch/model/simple_feedforward/estimator.py index 05f34a9fa2..5f82640e8b 100644 --- a/src/gluonts/torch/model/simple_feedforward/estimator.py +++ b/src/gluonts/torch/model/simple_feedforward/estimator.py @@ -14,7 +14,7 @@ from typing import List, Optional, Iterable, Dict, Any import torch -import lightning.pytorch as pl +import pytorch_lightning as pl from gluonts.core.component import validated from gluonts.dataset.common import Dataset diff --git a/src/gluonts/torch/model/simple_feedforward/lightning_module.py b/src/gluonts/torch/model/simple_feedforward/lightning_module.py index f03473e78d..b7cf9a529a 100644 --- a/src/gluonts/torch/model/simple_feedforward/lightning_module.py +++ b/src/gluonts/torch/model/simple_feedforward/lightning_module.py @@ -11,7 +11,7 @@ # express or implied. See the License for the specific language governing # permissions and limitations under the License. -import lightning.pytorch as pl +import pytorch_lightning as pl import torch from gluonts.core.component import validated diff --git a/src/gluonts/torch/model/tft/lightning_module.py b/src/gluonts/torch/model/tft/lightning_module.py index 4647d740fd..f6f7daa335 100644 --- a/src/gluonts/torch/model/tft/lightning_module.py +++ b/src/gluonts/torch/model/tft/lightning_module.py @@ -11,7 +11,7 @@ # express or implied. See the License for the specific language governing # permissions and limitations under the License. -import lightning.pytorch as pl +import pytorch_lightning as pl import torch from gluonts.core.component import validated from gluonts.itertools import select