BayraktarLab / cell2location

Comprehensive mapping of tissue cell architecture via integrated single cell and spatial transcriptomics (cell2location model)
https://cell2location.readthedocs.io/en/latest/
Apache License 2.0
321 stars 58 forks source link

Using gpu even when use_gpu=False in cell2location.models.RegressionModel.load() #273

Open bhhlee opened 1 year ago

bhhlee commented 1 year ago

Hi cell2location. First of all thank you so much for developing such a useful and much needed tool.

I am using cell2location without a GPU without issue, except when I try to load a saved regression model. Please see below for code and error:

adata_file = f"{ref_run_name}/sc.h5ad" adata_ref = sc.read_h5ad(adata_file) mod = cell2location.models.RegressionModel.load(f"{ref_run_name}", adata_ref, use_gpu=False)

image image It looks like the loading function is trying to use GPU despite saying use_GPU=False.

Thank you for your time!

dylanilee commented 1 year ago

It looks like this was a change in scvi-tools: https://github.com/scverse/scvi-tools/issues/1860.

vitkl commented 1 year ago

I need to investigate how to properly change various parts of the package to accommodate this scvi-tools change. Unfortunately, I can't do this until July.