JoePenna / Dreambooth-Stable-Diffusion

Implementation of Dreambooth (https://arxiv.org/abs/2208.12242) by way of Textual Inversion (https://arxiv.org/abs/2208.01618) for Stable Diffusion (https://arxiv.org/abs/2112.10752). Tweaks focused on training faces, objects, and styles.
MIT License
3.19k stars 558 forks source link

NameError: name 'trainer' is not defined #163

Closed Stoops0311 closed 1 year ago

Stoops0311 commented 1 year ago

Global seed set to 23 Traceback (most recent call last): File "main.py", line 656, in configs = [OmegaConf.load(cfg) for cfg in opt.base] File "main.py", line 656, in configs = [OmegaConf.load(cfg) for cfg in opt.base] File "/opt/conda/lib/python3.7/site-packages/omegaconf/omegaconf.py", line 189, in load with io.open(os.path.abspath(file_), "r", encoding="utf-8") as f: FileNotFoundError: [Errno 2] No such file or directory: '/workspace/Dreambooth-Stable-Diffusion/configs/stable-diffusion/v1-finetune_unfrozen_save_checkpoints_every_500_steps.yaml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "main.py", line 932, in if trainer.global_rank == 0: NameError: name 'trainer' is not defined

AmaruEscalante commented 1 year ago

+1 Did you solve it?

carlosvsm2 commented 1 year ago

I have the exact same issue with the NameError: name 'trainer' is not defined. I am hoping someone can help soon...

AmaruEscalante commented 1 year ago

Guys I found the solution. We aren't following the instructions on the readme well enough.

  1. Select Pytorch as your template Screenshot 2023-03-10 at 00 51 16
  2. Once you create it, edit the pod and remove all the versioning to just say runpod/pytorch, this I believe gets the latest version of the image, and voilá your code should run just fine. Screenshot 2023-03-10 at 00 53 19
Stoops0311 commented 1 year ago

Guys I found the solution. We aren't following the instructions on the readme well enough.

  1. Select Pytorch as your template
Screenshot 2023-03-10 at 00 51 16
  1. Once you create it, edit the pod and remove all the versioning to just say runpod/pytorch, this I believe gets the latest version of the image, and voilá your code should run just fine. Screenshot 2023-03-10 at 00 53 19

Nope sorry thats wrong, the problem i was having was becuase the repo itself was damaged it wasnt that we werent following the instructions i talked to the devs on discord they fixed the problem and changed some stuff, even the yaml script to save the models was missing before they fixed it dont worry but this is still a necessary step

Stoops0311 commented 1 year ago

if youre part of the server here is the link to the message and the changes they made

https://discord.com/channels/1023277529424986162/1026874778331643995/1083156685159415919

WildDogOne commented 1 year ago

god damn live saver right here :) works like a charm

AlexanderKozhevin commented 1 year ago

+1, same

elo0i commented 1 year ago

Guys I found the solution. We aren't following the instructions on the readme well enough.

  1. Select Pytorch as your template
Screenshot 2023-03-10 at 00 51 16
  1. Once you create it, edit the pod and remove all the versioning to just say runpod/pytorch, this I believe gets the latest version of the image, and voilá your code should run just fine. Screenshot 2023-03-10 at 00 53 19

Thanks! All working now! I forgot to switch to PyTorch in Vast.ai