As a powerful generative model, the Diffusion Model has "invaded" various low-level visual tasks. The existing Diffusion Models are all implemented based on Stable Diffusion, and some problems will be encountered when reproducing them. This blog post summarizes some bugs I encountered during the reappearance process and their solutions. Hope that helps.
1. from pytorch_lightning.utilities.distributed import rank_zero_only
Detailed description of the problem:
from pytorch_lightning.utilities.distributed import rank_zero_only
ModuleNotFoundError: No module named 'pytorch_lightning.utilities.distributed'
Solution: put
from pytorch_lightning.utilities.distributed import rank_zero_only
change into:
from pytorch_lightning.utilities.rank_zero import rank_zero_only
2. parser = Trainer.add_argparse_args(parser)
Detailed description of the problem:
parser = Trainer.add_argparse_args(parser)
AttributeError: type object 'Trainer' has no attribute 'add_argparse_args'
Reason: Because pytorch-lightening 2.x is not compatible with 1.x.
Solution: Downgrade pytorch-lightning , you can try
pip install pytorch-lightning==1.9.4