PyTorch-VAE icon indicating copy to clipboard operation
PyTorch-VAE copied to clipboard

AttributeError: 'VAEDataset' object has no attribute '_has_setup_TrainerFn.FITTING

Open Jarye0612 opened this issue 2 years ago • 2 comments

when i use vae.yaml,I get the error code:AttributeError: 'VAEDataset' object has no attribute '_has_setup_TrainerFn.FITTING,how to fix the problem? PS: pytorch_lightning==1.5.6 torch==2.0.1

Jarye0612 avatar Sep 11 '23 10:09 Jarye0612

Hi @Jarye0612,

I got the same error. Try to install the following configuration:

  • pytorch-lightning ==1.8.4
  • torch==2.0.0
  • torchvision==0.15.0

CristianoPatricio avatar Sep 25 '23 15:09 CristianoPatricio

Maybe someone is still interested in this issue...

I use pytorch-lightning == 1.5.10. This works with Python 3.10.x but not with 3.11.x.

The problem is that Python 3.11 changed the way how Enums are formatted. PyTorch-Lightning does the following: name = "setup" stage = TrainerFn.FITTING attr = f"has{name}_{stage}" has_run = getattr(obj, attr)

where TrainerFn is an Enum: class TrainerFn(LightningEnum): FITTING = "fit" VALIDATING = "validate" ...

In Python 3.10.x this results in '_has_setup_fit'. In Python >=3.11.0 this leads to '_has_setup_TrainerFn.FITTING'

alexanderfroeber avatar Jun 21 '24 08:06 alexanderfroeber