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

RAM issues when returning the regularization path #26

Open
alexandre-pasco opened this issue Dec 19, 2022 · 1 comment
Open

RAM issues when returning the regularization path #26

alexandre-pasco opened this issue Dec 19, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@alexandre-pasco
Copy link

Hello,

When I use spams.lasso (and spams.omp) with return_reg_path=True, my RAM usage keeps increasing, and I don't get it back afterwise. So, by calling this function too often, my kernel crashes because of the RAM overconsumption. Do you have any ideas to solve this issue ? Thank you very much in advance.

The piece of code below shows the issue. I run it with python 3.9.15, spams 2.6.5.4, numpy 1.22.3 and psutil 5.9.0.

import psutil
import numpy as np
import spams

D = np.random.normal(size=(100, 1000))
D = D / np.linalg.norm(D, axis=0)
D = np.asfortranarray(D)
X = np.random.normal(size=(100, 100))
X = X / np.linalg.norm(X, axis=0)
X = np.asfortranarray(X)

for k in range(100):
    used_ram = psutil.virtual_memory().percent
    print(f'\rk:{k} used RAM:{used_ram}', end='')
    c, path = spams.lasso(X, D, lambda1=0, mode=2, return_reg_path=True)
@gdurif
Copy link
Contributor

gdurif commented Jan 16, 2023

Hi,
Sorry for the very late reply. Thanks for reporting this. We will have to investigate to find the origin of the problem and get back to you.
Best,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants