AssemblyAI-Community / MinImagen

MinImagen: A minimal implementation of the Imagen text-to-image model
https://assemblyai-examples.github.io/MinImagen/
MIT License
294 stars 54 forks source link

inference.py #9

Open Shikamaru5 opened 2 years ago

Shikamaru5 commented 2 years ago

Do you happen to have another way to run inference.py? Main.py is too much for my computer to handle so I ran and created a training directory using train.py, however, when I try to run inference.py, it simply won't recognize the arguments. I've tried anywhere from inference.py --captions.txt --training_20221106_101837 to inference.py [-c] [-d]. Nothing I've ran seems to work, I've had to add torch imports in order to get it to work on its own but otherwise I'm at a loss. Any help would be greatly appreciated.

DataDetactive commented 1 year ago

Hi @Shikamaru5 , I hope you found the solution of your problem. If not, I faced similar problem and I solve it by using this command python inference.py -c captions.txt --TRAINING_DIRECTORY training_20221207_125134 I hope it works for you.

Shikamaru5 commented 1 year ago

hey @DataDetactive thank you for this, I may have to look into it, I've gone onto working with the actual Imagen but I really do appreciate it.

DataDetactive commented 1 year ago

hey @Shikamaru5 , Great that you started on the original Imagen. I have question for you since you started the original imagen. Do you know how I make the model work on 2 GPUs because one GPU is not sufficient. since I saw the guidelines which the authors added I did not know how I use it.

Shikamaru5 commented 1 year ago

hey @DataDetactive, something I've been looking into is called DeepSpeed it's a program that allows you to pass data from the gpu to the cpu back to the gpu, or something along those lines. Basically it can allow a single GPU to train LLM up to the billions of parameters. Unfortunately as I use Windows it is not supported even though it's developed by Microsoft, so I've been researching how to use it with Docker. I believe that I have figured out how to do this but it did take significant digging. As for your question about multi-gpus, the documentation for Imagen or the proxy I found says that for training on multi-gpus it can be done with a program called Accelerate. It has me curious now because it says that it looks like this program has a number of useful functions including using multi-gpus in a way that you could have functions wait to be processed before continuing with further instructions and it can even utilize DeepSpeed. You can also use it to deal with the out-of-memory error to some degree by using a function called find_executable_batch_size. I hope this helps at all, this has been a challenge to deal with since I just have one gpu but hopefully through experimentation and a little duct tape someone may be able to solve these limitations.

DataDetactive commented 1 year ago

@Shikamaru5 , Great thank you for the information. I will try my best with accelerate to know how I could make it works. As soon as I know I will tell you. Thanks again for your help. Really appreciate it.

Shikamaru5 commented 1 year ago

You're welcome, I hope it works out for you.

On Tue, Dec 13, 2022 at 2:20 AM Karim Elgohary @.***> wrote:

@Shikamaru5 https://github.com/Shikamaru5 , Great thank you for the information. I will try my best with accelerate to know how I could make it works. As soon as I know I will tell you. Thanks again for your help. Really appreciate it.

— Reply to this email directly, view it on GitHub https://github.com/AssemblyAI-Examples/MinImagen/issues/9#issuecomment-1348019107, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUT6VTNB3VVDZGQ3ZANYQYTWNA5XPANCNFSM6AAAAAARYRDS7A . You are receiving this because you were mentioned.Message ID: @.***>