rinongal / textual_inversion

MIT License
2.9k stars 279 forks source link

You have to specify the number of GPUs you would like to use, add `num_processes=...` to your call. #75

Closed CptJackieSparrow closed 1 year ago

CptJackieSparrow commented 2 years ago

Hey guys i'm trying to run the code on colab connected to my local runtime I'm having this error;

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In [93], line 2
      1 import accelerate
----> 2 accelerate.notebook_launcher(training_function, args=(text_encoder, vae, unet))

File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\accelerate\launchers.py:87, in notebook_launcher(function, args, num_processes, use_fp16, mixed_precision, use_port)
     85 else:
     86     if num_processes is None:
---> 87         raise ValueError(
     88             "You have to specify the number of GPUs you would like to use, add `num_processes=...` to your call."
     89         )
     91     if num_processes > 1:
     92         # Multi-GPU launch
     93         if is_torch_version("<", "1.5.0"):

ValueError: You have to specify the number of GPUs you would like to use, add `num_processes=...` to your call.

And when i call the number of processes with accelerate.notebook_launcher(training_function, args=(text_encoder, vae, unet), num_processes=1) it uses CPU instead of GPU so training seems to go for 24 hours. Is there any solutions for that?

rinongal commented 2 years ago

Which colab is this? The huggingface diffusers one?

atomical commented 2 years ago

Has anyone had success running with 4+ GPU's?

rinongal commented 2 years ago

@atomical What error are you getting on those 4+ GPU runs?

rinongal commented 1 year ago

Closing due to lack of activity. Feel free to reopen if you need more help.

KaiyueSun98 commented 1 year ago

I have the same ValueError when running the huggingface diffusers colab. Does anyone know how to solve it?