You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of anndata.
(optional) I have confirmed this bug exists on the master branch of anndata.
Report
Hello,
Using the lazy loader, I am trying to load a big h5ad file that can't fit into memory. It works as expected and doesn't load the whole file into memory at the start.
However, if I started to read the data row by row, the memory utilization increased to the same file size.
My expectation is that the lazy loader should read each row and free its associated memory after it is deleted, which is not the case.
How can we solve this issue?
Code:
import scanpy as sc
import sys
from tqdm import tqdm
file_name = "file.h5ad"
adata_r = sc.read_h5ad(file_name, backed="r")
for idx in tqdm(range(adata_r.X.shape[0])):
row = adata_r.X[idx].toarray()
del row
Hello @agemagician, we will need a little bit more to go on here. Your example did not produce the same results for me on a large dataset I had locally. Could you share your dataset? Could it be CSC?
This issue has been automatically marked as stale because it has not had recent activity.
Please add a comment if you want to keep the issue open. Thank you for your contributions!
Please make sure these conditions are met
Report
Hello,
Using the lazy loader, I am trying to load a big h5ad file that can't fit into memory. It works as expected and doesn't load the whole file into memory at the start.
However, if I started to read the data row by row, the memory utilization increased to the same file size.
My expectation is that the lazy loader should read each row and free its associated memory after it is deleted, which is not the case.
How can we solve this issue?
Code:
Versions
The text was updated successfully, but these errors were encountered: