zhoux85 / STAligner

STAligner is a tool for alignment and integration of spatially resolved transcriptomics data.
MIT License
29 stars 5 forks source link

Error about out of memory. #13

Open DBinary opened 11 months ago

DBinary commented 11 months ago

Great job! I have successfully run the staligner. However, when dealing with a large number of samples, staligner still out of memory. Upon inspection, I found that in line 387 of the train_STAligner.py file, x=torch.FloatTensor(batch_pair.X.todense()), converting a sparse matrix to a dense matrix is causing the problem that out of memory. Could you please suggest optimizations for this?

figure
zhoux85 commented 11 months ago

Hi. I have updated the train_STAligner.py file with line 387 and 397. The step of converting sparse matrix to a dense matrix is moved to line 397.

DBinary commented 10 months ago

Hi, I have solved this problem while I updated the train_STAligner.py. Thank you very much!

xuzaoxu commented 8 months ago

Hi Zhou, Thank you for your job. When I try to concat the spatial network for multiple slices, about 160,000 spots for two slice, STAligner out of memory. I used the train_STAligner.py you updated two months ago, still not work. Do you have any suggestion? Thanks in advance.