Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible memory leak in lsqr #3128

Open
ryan-budde opened this issue Jul 2, 2024 · 0 comments
Open

possible memory leak in lsqr #3128

ryan-budde opened this issue Jul 2, 2024 · 0 comments
Labels
motion correction Questions related to motion correction

Comments

@ryan-budde
Copy link

In motion estimation global displacement lsqr robust I encountered OOM issues, similar to those encountered with the lsmr. Maybe a leak. I also fixed with gc.collect() but for some reason I had issues with the import. This is my code block:

        # TODO: this is already soft_weights
        import gc
        xrange = trange if progress_bar else range
        for i in xrange(lsqr_robust_n_iter):
            p = lsqr(A[idx].multiply(W[idx]), V[idx] * W[idx][:, 0])[0]
            idx = np.nonzero(np.abs(zscore(A @ p - V)) <= robust_regression_sigma)
            import gc
            gc.collect()
            # print('temporary memory cleared')
        displacement = p
        gc.collect()
        print('temporary memory cleared')

I never bothered to figure out which of these two did the job. Just an FYI

@alejoe91 alejoe91 added the motion correction Questions related to motion correction label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
motion correction Questions related to motion correction
Projects
None yet
Development

No branches or pull requests

2 participants