autonomousvision / stylegan-xl

[SIGGRAPH'22] StyleGAN-XL: Scaling StyleGAN to Large Diverse Datasets
MIT License
961 stars 113 forks source link

UnboundLocalError: cannot access local variable 'cur_nimg' where it is not associated with a value #108

Open hailuu684 opened 1 year ago

hailuu684 commented 1 year ago

Dear @xl-sr , I am training my custom dataset and I encountered the error above. I am not sure how to fix it even though I have looked at the code. Also, I only have 1 GPU, so I left --gpus=1 and --batch-gpu 64. The rest are the same as your instruction.

` File "/home/luu/.conda/envs/distilledDS_CL/lib/python3.11/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^

File "/home/luu/.conda/envs/distilledDS_CL/lib/python3.11/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/luu/.conda/envs/distilledDS_CL/lib/python3.11/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/home/luu/DistilledDataset_ContinualLearning/author_distilled_dataset/glad/stylegan_xl/train.py", line 321, in main launch_training(c=c, desc=desc, outdir=opts.outdir, dry_run=opts.dry_run)

File "/home/luu/DistilledDataset_ContinualLearning/author_distilled_dataset/glad/stylegan_xl/train.py", line 104, in launch_training subprocess_fn(rank=0, c=c, temp_dir=temp_dir)

File "/home/luu/DistilledDataset_ContinualLearning/author_distilled_dataset/glad/stylegan_xl/train.py", line 49, in subprocess_fn training_loop.training_loop(rank=rank, **c)

File "/home/luu/DistilledDataset_ContinualLearning/author_distilled_dataset/glad/stylegan_xl/training/training_loop.py", line 208, in training_loop 'cur_nimg': torch.LongTensor([cur_nimg]),

UnboundLocalError: cannot access local variable 'cur_nimg' where it is not associated with a value `