Code Monkey home page Code Monkey logo

Comments (7)

BBBBryanPan avatar BBBBryanPan commented on August 11, 2024 1

Hey,
I just find out a solution to decrease the memory spending. Since 3 variable:prediction_probability_axial,prediction_probability_coronal, prediction_probability_sagittal is no longer used after
_, prediction_image = torch.max(torch.add(torch.mul(torch.add(prediction_probability_axial, prediction_probability_coronal), 0.4), torch.mul(prediction_probability_sagittal, 0.2)), 3)
We can use
a = torch.add(prediction_probability_axial, prediction_probability_coronal) del prediction_probability_axial,prediction_probability_coronal
to save the memory used by the two variables. From my experience, this step save 5GB memory and the script will fit in well with 32GB ram system.

Best,
Boyang

from fastsurfer.

LeHenschel avatar LeHenschel commented on August 11, 2024

Hey,

I will have a look at it, but it is possible that the view aggregation does indeed need a lot of CPU memory due to the large number of feature maps (95 classes).

Best,
Leonie

from fastsurfer.

BBBBryanPan avatar BBBBryanPan commented on August 11, 2024

Thanks a lot. And may I ask how many memory at least is required to run fastsurferCNN/eval.py for one image with size like (179x256x256)?

from fastsurfer.

m-reuter avatar m-reuter commented on August 11, 2024

Your RAM should be sufficient (at least if you run step i CNN segmentation on the GPU, where you might need to reduce batch size, e.g. try 8). On our GPU it takes 40 sec with 8GB RAM (RTX 2080). For the part ii, 32 Gig CPU RAM should really be enough. Only the view aggregation seems to be very memory hungry (probably around 30Gig) so could be that that is the problem if other stuff is loaded.

from fastsurfer.

BBBBryanPan avatar BBBBryanPan commented on August 11, 2024

OK, thanks, I'll try that. Another thing is that does your network support nifti format input? We use nifti format to store our brain mri images.

from fastsurfer.

LeHenschel avatar LeHenschel commented on August 11, 2024

Hey,

yes, nifti format is supported as well (see also #20 ).

Best,
Leonie

from fastsurfer.

LeHenschel avatar LeHenschel commented on August 11, 2024

Hey Boyang,

thank you :). I added the change with commit 25609f2. In total, this makes the view aggregation slightly slower (2-4 s on average on my machine). I would however consider this as tolerable given that it assures usage on the 32GB ram system.

Best,
Leonie

from fastsurfer.

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.