Make BYOT imports forward compatible (#16997)

This commit is contained in:
Adrian Wälchli 2023-03-14 02:55:32 +01:00 committed by GitHub
parent a8c4d1f552
commit c93952cb2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 6 deletions

View File

@ -4,11 +4,14 @@ from functools import partial
from typing import Any, cast, Iterable, List, Literal, Optional, Tuple, Union
import torch
from lightning_utilities.core import apply_to_collection, is_overridden
from lightning_utilities import apply_to_collection, is_overridden
from tqdm import tqdm
import lightning as L
from lightning.fabric.fabric import _unwrap_objects, Accelerator, Fabric, Logger, Strategy
from lightning.fabric.accelerators import Accelerator
from lightning.fabric.loggers import Logger
from lightning.fabric.strategies import Strategy
from lightning.fabric.wrappers import _unwrap_objects
class MyCustomTrainer:
@ -82,7 +85,7 @@ class MyCustomTrainer:
callbacks written for the lightning trainer (especially making assumptions on the trainer), won't work!
"""
self.fabric = Fabric(
self.fabric = L.Fabric(
accelerator=accelerator,
strategy=strategy,
devices=devices,

View File

@ -7,7 +7,7 @@ fsspec>=2022.5.0, <=2022.7.1
croniter>=1.3.0, <1.4.0 # strict; TODO: for now until we find something more robust.
traitlets>=5.3.0, <5.9.0
arrow>=1.2.0, <1.2.4
lightning-utilities>=0.7.0, <0.8.0
lightning-utilities>=0.7.0, <0.9.0
beautifulsoup4>=4.8.0, <4.11.2
inquirer>=2.10.0, <=3.1.2
psutil<5.9.5

View File

@ -6,4 +6,4 @@ torch>=1.11.0, <=2.0.0
fsspec[http]>2021.06.0, <2023.2.0
packaging>=17.1, <=23.0
typing-extensions>=4.0.0, <=4.4.0
lightning-utilities>=0.7.0, <0.8.0
lightning-utilities>=0.7.0, <0.9.0

View File

@ -3,3 +3,4 @@
torchvision>=0.10.0, <=0.14.1
torchmetrics>=0.10.0, <0.12.0
lightning-utilities>=0.8.0, <0.9.0

View File

@ -9,4 +9,4 @@ fsspec[http]>2021.06.0, <2023.2.0
torchmetrics>=0.7.0, <0.12.0 # needed for using fixed compare_version
packaging>=17.1, <=23.0
typing-extensions>=4.0.0, <=4.4.0
lightning-utilities>=0.7.0, <0.8.0
lightning-utilities>=0.7.0, <0.9.0

View File

@ -5,3 +5,4 @@ torchvision>=0.11.1, <=0.14.1
gym[classic_control]>=0.17.0, <0.26.3
ipython[all] <8.7.1
torchmetrics>=0.10.0, <0.12.0
lightning-utilities>=0.7.0, <0.9.0