问题详细描述:
from pytorch_lightning.utilities.distributed import rank_zero_only
ModuleNotFoundError: No module named 'pytorch_lightning.utilities.distributed'
解决方案:将
from pytorch_lightning.utilities.distributed import rank_zero_only
修改为:
from pytorch_lightning.utilities.rank_zero import rank_zero_only
问题详细描述:
from taming.modules.vqvae.quantize import VectorQuantizer2 as VectorQuantizer
ImportError: cannot import name 'VectorQuantizer2' from 'taming.modules.vqvae.quantize'
原因:新的taming版本不存在VectorQuantizer2
解决方案:
解决方案:将
from taming.modules.vqvae.quantize import VectorQuantizer2 as VectorQuantizer
修改为:
from taming.modules.vqvae.quantize import VectorQuantizer
问题详细描述:
parser = Trainer.add_argparse_args(parser)
AttributeError: type object 'Trainer' has no attribute 'add_argparse_args'
原因:因为pytorch-lightening 2.x已经不兼容1.x。
解决方案:将 pytorch-lightning降级, 可以尝试
pip install pytorch-lightning==1.9.4