Skip to content

Memory resource management #2

@aisosalo

Description

@aisosalo

When I recently run the model inference on a low-resource device, there were some memory issues with the largest image stacks. I solved the issue by introducing a gc.collect() to the run_model() function and torch.cuda.empty_cache() to the run_single_model() and del model command when running the pipeline for an "ensemble" of models. These were very random actions to alleviate the memory issue, but perhaps they can help someone else struggling with similar problem, so I post them here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions