Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hailuu684 opened this issue Jul 19, 2023 · 0 comments

Comments

@hailuu684
Copy link

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
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant