Advertisement
chienthan91

Dreambooth error

Oct 6th, 2022 (edited)
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.47 KB | Source Code | 0 0
  1. (diffusers) luongngo91@DESKTOP-7MQOI52:~/github/diffusers/examples/dreambooth$ ./launch.sh
  2. The following values were not passed to `accelerate launch` and had defaults used instead:
  3. `--num_cpu_threads_per_process` was set to `8` to improve out-of-box performance
  4. To avoid this warning pass in values for each of the problematic parameters or run `accelerate config`.
  5. Fetching 16 files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:00<00:00, 5697.81it/s]
  6. Generating class images: 0%| | 0/3 [00:23<?, ?it/s]
  7. Traceback (most recent call last):
  8. File "/home/luongngo91/github/diffusers/examples/dreambooth/train_dreambooth.py", line 637, in <module>
  9. main()
  10. File "/home/luongngo91/github/diffusers/examples/dreambooth/train_dreambooth.py", line 380, in main
  11. images = pipeline(example["prompt"]).images
  12. File "/home/luongngo91/anaconda3/envs/diffusers/lib/python3.9/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
  13. return func(*args, **kwargs)
  14. File "/home/luongngo91/anaconda3/envs/diffusers/lib/python3.9/site-packages/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py", line 303, in __call__
  15. noise_pred = self.unet(latent_model_input, t, encoder_hidden_states=text_embeddings).sample
  16. File "/home/luongngo91/anaconda3/envs/diffusers/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
  17. return forward_call(*input, **kwargs)
  18. File "/home/luongngo91/anaconda3/envs/diffusers/lib/python3.9/site-packages/diffusers/models/unet_2d_condition.py", line 309, in forward
  19. sample = upsample_block(
  20. File "/home/luongngo91/anaconda3/envs/diffusers/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
  21. return forward_call(*input, **kwargs)
  22. File "/home/luongngo91/anaconda3/envs/diffusers/lib/python3.9/site-packages/diffusers/models/unet_blocks.py", line 1151, in forward
  23. hidden_states = attn(hidden_states, context=encoder_hidden_states)
  24. File "/home/luongngo91/anaconda3/envs/diffusers/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
  25. return forward_call(*input, **kwargs)
  26. File "/home/luongngo91/anaconda3/envs/diffusers/lib/python3.9/site-packages/diffusers/models/attention.py", line 154, in forward
  27. hidden_states = block(hidden_states, context=context)
  28. File "/home/luongngo91/anaconda3/envs/diffusers/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
  29. return forward_call(*input, **kwargs)
  30. File "/home/luongngo91/anaconda3/envs/diffusers/lib/python3.9/site-packages/diffusers/models/attention.py", line 203, in forward
  31. hidden_states = self.attn1(self.norm1(hidden_states)) + hidden_states
  32. File "/home/luongngo91/anaconda3/envs/diffusers/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
  33. return forward_call(*input, **kwargs)
  34. File "/home/luongngo91/anaconda3/envs/diffusers/lib/python3.9/site-packages/diffusers/models/attention.py", line 278, in forward
  35. hidden_states = self._attention(query, key, value)
  36. File "/home/luongngo91/anaconda3/envs/diffusers/lib/python3.9/site-packages/diffusers/models/attention.py", line 287, in _attention
  37. attention_probs = attention_scores.softmax(dim=-1)
  38. RuntimeError: CUDA out of memory. Tried to allocate 4.00 GiB (GPU 0; 12.00 GiB total capacity; 4.25 GiB already allocated; 1.38 GiB free; 8.24 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
  39. Traceback (most recent call last):
  40. File "/home/luongngo91/anaconda3/envs/diffusers/bin/accelerate", line 8, in <module>
  41. sys.exit(main())
  42. File "/home/luongngo91/anaconda3/envs/diffusers/lib/python3.9/site-packages/accelerate/commands/accelerate_cli.py", line 43, in main
  43. args.func(args)
  44. File "/home/luongngo91/anaconda3/envs/diffusers/lib/python3.9/site-packages/accelerate/commands/launch.py", line 837, in launch_command
  45. simple_launcher(args)
  46. File "/home/luongngo91/anaconda3/envs/diffusers/lib/python3.9/site-packages/accelerate/commands/launch.py", line 354, in simple_launcher
  47. raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
  48. subprocess.CalledProcessError: Command '['/home/luongngo91/anaconda3/envs/diffusers/bin/python', 'train_dreambooth.py', '--pretrained_model_name_or_path=CompVis/stable-diffusion-v1-4', '--instance_data_dir=training', '--class_data_dir=classes', '--output_dir=model', '--with_prior_preservation', '--prior_loss_weight=1.0', '--instance_prompt=a photo of sks cat', '--class_prompt=a photo of cat', '--seed=1337', '--resolution=512', '--center_crop', '--train_batch_size=1', '--mixed_precision=fp16', '--use_8bit_adam', '--gradient_accumulation_steps=1', '--learning_rate=5e-6', '--lr_scheduler=constant', '--lr_warmup_steps=0', '--num_class_images=12', '--sample_batch_size=4', '--max_train_steps=900', '--gradient_checkpointing']' returned non-zero exit status 1.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement