mirror of
https://github.com/Stability-AI/stablediffusion.git
synced 2024-12-22 07:34:58 +00:00
Fix import error in newer version of lighting.
Newer lighting versions move `rank_zero_only` from the distributed subpackage back to utilities. This commit adds a try-except to catch that import error, and retry with the alternative.
This commit is contained in:
parent
cf1d67a6fd
commit
eeeb184071
1 changed files with 4 additions and 1 deletions
|
@ -17,7 +17,10 @@ from functools import partial
|
|||
import itertools
|
||||
from tqdm import tqdm
|
||||
from torchvision.utils import make_grid
|
||||
from pytorch_lightning.utilities.distributed import rank_zero_only
|
||||
try:
|
||||
from pytorch_lightning.utilities import rank_zero_only
|
||||
except:
|
||||
from pytorch_lightning.utilities.distributed import rank_zero_only
|
||||
from omegaconf import ListConfig
|
||||
|
||||
from ldm.util import log_txt_as_img, exists, default, ismap, isimage, mean_flat, count_params, instantiate_from_config
|
||||
|
|
Loading…
Reference in a new issue