KIMGEONUNG / BigColor

[ECCV 2022] Official PyTorch implementation of "BigColor"
MIT License
141 stars 22 forks source link

cuda out of memory #9

Open stphtan94117 opened 1 year ago

stphtan94117 commented 1 year ago

hi sir my GPU is nvidia RTX3080, its cuda memory is 10 GB i run "sh ./scripts/colorize.real.sh" it will show cuda out of memory..... Where can I modify the batch or size?

thanks

KIMGEONUNG commented 1 year ago

Thank you for your interest on our project.

The script 'colorize.real.sh' is set to use a batch size of 1, so changing the batch size will not solve the problem. The amount of GPU memory needed depends on the aspect ratio of the input image because the script uses a resize trick to set the shorter length to 256. When colorizing a square image, it requires about 6GB of memory. I suspect you tried using an image with a larger aspect ratio.There are two options you could try. The first is to crop your image to reduce the aspect ratio. The other option is to reduce the '--size_target' option in the 'colorize.real.sh' script, which is set to 256 by default. Keep in mind that this may degrade the quality of the output.

stphtan94117 commented 1 year ago

I have reduced the photo to 160x120pixel, and then changed --size_target to 16, but cuda out of memory still appears. image image image

KIMGEONUNG commented 1 year ago

This is really wierd. A possible scenario I can imagine is that there is an other process which is using a huge parts of the GPU memory. Did you check the remaining usage GPU memory before you run the script?

stphtan94117 commented 1 year ago

i have checked the remaining usage GPU memory before I run the script.

https://user-images.githubusercontent.com/110151053/211456164-ad60a9b2-7d77-4ef0-a7f1-a9be8d3408df.mp4

only 'colorize.real.sh' is no working.

colorize.multi_c.sh、colorize.multi_z.sh、infer.bigcolor.e011.sh,they are working for my computer. it is so wierd.

KIMGEONUNG commented 1 year ago

I'm sorry it is really hard to know what the problem is. The next steps I can recommend to you are as follow

Or there is a way to conduct inference through web. https://replicate.com/cjwbw/bigcolor

stphtan94117 commented 1 year ago

I'm sorry it is really hard to know what the problem is. The next steps I can recommend to you are as follow

  • Check the version of Pytorch. v1.10.0
  • Use Ubuntu 20.04.2 LTS operation system

Or there is a way to conduct inference through web. https://replicate.com/cjwbw/bigcolor

my Pytorch is v1.10, but operation system is windows 10. so windows 10 can not inference it? I don't think it has anything to do with the operating system(win10), because several other .sh files can execute.

I have used that website but I am not satisfied with the results. I use deoldify, no matter the speed or coloring is good,but it cannot train.

can you write a code to put on colab?

ohagithub commented 1 year ago

Maybe try running the device in cup mode (see if it works) --device=cpu

I was --topk default=5, but I couldn't succeed, and a blank paper came out. Changing to topk default=1 is ok, but the color is weird.

(^~^;)ゞ May I ask what aspect is the setting of topk related to?

name = path.split('/')[-1].split('.')[0] is always wrong. Changed to name =os.path.basename(path) is finally OK.

(Ɔ˘⌣˘)(˘⌣˘)˘⌣˘ C)