jiupinjia / stylized-neural-painting

Official Pytorch implementation of the preprint paper "Stylized Neural Painting", in CVPR 2021.
https://jiupinjia.github.io/neuralpainter/
Creative Commons Zero v1.0 Universal
1.56k stars 262 forks source link

Some thing about CUDA #34

Open tychey opened 3 years ago

tychey commented 3 years ago

HI:

When I execute demo.py

I meet the bug as below:

RuntimeError: CUDA out of memory. Tried to allocate 626.00 MiB (GPU 0; 8.00 GiB total capacity; 3.71 GiB already allocated; 469.62 MiB free; 5.58 GiB reserved in total by PyTorch)

The model I choose is bigger one: ./checkpoints_G_oilpaintbrush

The net_G I choose is zou-fusion-net

Hope your answer.

Thank you.

tychey commented 3 years ago

I think maybe change the batch_size will help, but I didn't find it

should I increase or decrease the arg m_grid?

jiupinjia commented 3 years ago

Hi, sorry for the late response. You can try using a smaller stroke number, e.g., by reducing --max_m_strokes from 500 to 300.

Also you can try our lightweight renderer: python demo_prog.py --img_path ./test_images/apple.jpg --canvas_color 'white' --max_m_strokes 500 --max_divide 5 --renderer oilpaintbrush --renderer_checkpoint_dir checkpoints_G_oilpaintbrush_light --net_G zou-fusion-net-light Hope it helps. Thanks!