Giter Site home page Giter Site logo

cuda out of memory about sugar HOT 11 OPEN

Freeverc avatar Freeverc commented on May 26, 2024
cuda out of memory

from sugar.

Comments (11)

JuliusQv avatar JuliusQv commented on May 26, 2024 7

suagr_model will load the dataset to the GPU by default, which will consume a lot of GPU memory.

So, you can try the fllowing steps:

  1. modified this code, image_height=image_height, image_width=image_width, data_device='cpu')
  2. move the image to cuda during training process, modified this code gt_image = nerfmodel.get_gt_image(camera_indices=camera_indices).cuda()
  3. same action in coarse_density.py and refined.py

By use this method,
2000+images on my 24GB device 4090 is okay.

Hope this help.

from sugar.

yuedajiong avatar yuedajiong commented on May 26, 2024

My GPU is OK: 12G Beggar's,700*1200 size, 240 images.

  1. reduce image size
  2. reduce gauss-points (important, BUT maybe your images are very complex.)

from sugar.

cubantonystark avatar cubantonystark commented on May 26, 2024

if the error is directly related to pytorch reserving GPU memory, you can try adding:

os.environ["PYTORCH_NO_CUDA_MEMORY_CACHING"]= "1"

and clearing the cache with

torch.cuda.empty_cache()

Hope that helps

from sugar.

cubantonystark avatar cubantonystark commented on May 26, 2024

from sugar.

cubantonystark avatar cubantonystark commented on May 26, 2024

from sugar.

cubantonystark avatar cubantonystark commented on May 26, 2024

from sugar.

JuliusQv avatar JuliusQv commented on May 26, 2024

Julius, Are you reducing image size bwfore processing?  Got OOM again.  My dataset is only 26 images at 1900x1423.Best regards,Reynel RodriguezOn Dec 22, 2023 01:40, Reynel Rodriguez @.> wrote: Please disregard previous email, I had mistyped the suggestion and formatted the parentheses in …camera_indices).cuda() as …camera_indices.cuda())   My mistake. I’m rerunning my datasets again now. Will report back with results. Anttwo, please let me know if you would like me to share results of my dataset with you to showcase quality.   Sent from Mail for Windows   From: julius Sent: Thursday, December 21, 2023 9:09 PM To: Anttwo/SuGaR Cc: Cuban Tony Stark; Comment Subject: Re: [Anttwo/SuGaR] cuda out of memory (Issue #40)   suagr_model will load the dataset to the GPU by default, which will consume a lot of GPU memory. So, you can try the fllowing steps: modified this code, image_height=image_height, image_width=image_width, data_device='cpu') move the image to cuda during training process, modified this code gt_image = nerfmodel.get_gt_image(camera_indices=camera_indices).cuda() same action in coarse_density.py and refined.py By use this method, 2000+images on my 24GB device 4090 is okay. Hope this help. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

No,I did not reduce the images size.
What GPU are you using and how much memory?
And which step does OOM happen?
In my experiments, I found that the final texture mesh extraction stage requires a large amount of GPU memory.

from sugar.

cubantonystark avatar cubantonystark commented on May 26, 2024

from sugar.

cubantonystark avatar cubantonystark commented on May 26, 2024

from sugar.

WN-Wolf avatar WN-Wolf commented on May 26, 2024

suagr_model will load the dataset to the GPU by default, which will consume a lot of GPU memory.

So, you can try the fllowing steps:

  1. modified this code, image_height=image_height, image_width=image_width, data_device='cpu')
  2. move the image to cuda during training process, modified this code gt_image = nerfmodel.get_gt_image(camera_indices=camera_indices).cuda()
  3. same action in coarse_density.py and refined.py

By use this method, 2000+images on my 24GB device 4090 is okay.

Hope this help.

It's very useful, thanks!!!

from sugar.

MagicJoeXZ avatar MagicJoeXZ commented on May 26, 2024

suagr_model will load the dataset to the GPU by default, which will consume a lot of GPU memory.

So, you can try the fllowing steps:

modified this code, image_height=image_height, image_width=image_width, data_device='cpu')
move the image to cuda during training process, modified this code gt_image = nerfmodel.get_gt_image(camera_indices=camera_indices).cuda()
same action in coarse_density.py and refined.py
By use this method, 2000+images on my 24GB device 4090 is okay.

Hope this help.

Verified this works well!

Besides the suggestion above, i also change device type here from cuda to cpu

from sugar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.