kohya-ss/sd-scripts

35D Train Lora Error when sample。

Closed this issue · 2 comments

Using cached text encoder outputs for prompt: MY021 a woman standing in front of a white background wearing a beige puffer jacket and green pants. The jacket has a high neckline and long sleeves, and the pants have a slim fit. The woman has her hands in her pockets and a confident stance.
Encoding prompt: MY021 a woman standing in front of a white background wearing a beige puffer jacket and green pants. The jacket has a high neckline and long sleeves, and the pants have a slim fit. The woman has her hands in her pockets and a confident stance.
Using cached text encoder outputs for prompt:
Encoding prompt:
Traceback (most recent call last):
File "D:\pinokio\api\ajfluxlora\sd-scripts-3.5\sd3_train_network.py", line 426, in
trainer.train(args)
File "D:\pinokio\api\ajfluxlora\sd-scripts-3.5\train_network.py", line 1234, in train
self.sample_images(
File "D:\pinokio\api\ajfluxlora\sd-scripts-3.5\sd3_train_network.py", line 256, in sample_images
sd3_train_utils.sample_images(
File "D:\pinokio\api\ajfluxlora\sd-scripts-3.5\library\sd3_train_utils.py", line 426, in sample_images
sample_image_inference(
File "D:\pinokio\api\ajfluxlora\sd-scripts-3.5\library\sd3_train_utils.py", line 558, in sample_image_inference
latents = do_sample(height, width, seed, cond, neg_cond, mmdit, sample_steps, scale, vae.dtype, accelerator.device)
File "D:\pinokio\api\ajfluxlora\sd-scripts-3.5\library\sd3_train_utils.py", line 320, in do_sample
torch.randn(latent.size(), dtype=torch.float32, layout=latent.layout, generator=generator, device="cpu")
UnboundLocalError: local variable 'generator' referenced before assignment
steps: 20%|██████████▍ | 1380/6900 [29:13<1:56:52, 1.27s/it, avr_loss=0.0568]
Traceback (most recent call last):
File "d:\pinokio\bin\miniconda\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "d:\pinokio\bin\miniconda\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "D:\pinokio\api\ajfluxlora\env\Scripts\accelerate.exe_main
.py", line 7, in
File "d:\pinokio\api\ajfluxlora\env\lib\site-packages\accelerate\commands\accelerate_cli.py", line 48, in main
args.func(args)
File "d:\pinokio\api\ajfluxlora\env\lib\site-packages\accelerate\commands\launch.py", line 1106, in launch_command
simple_launcher(args)
File "d:\pinokio\api\ajfluxlora\env\lib\site-packages\accelerate\commands\launch.py", line 704, in simple_launcher
raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)

This error occurred if no seed was specified when generating sample images. Fixed.

thanks