pin_memory option should be explicit in cell2location
See original GitHub issueDear developers, I was trying to run the following code:
import scvi
scvi.data.setup_anndata(adata=A1_fil, batch_key="in_tissue")
scvi.data.view_anndata_setup(A1_fil)
modA1fil = cell2location.models.Cell2location(
A1_fil, cell_state_df=inf_aver_filraw,
N_cells_per_location=8,
detection_alpha=200)
modA1fil.train(max_epochs=40000,
batch_size=None,
train_size=1,
use_gpu=True)`
After the print of scvi.data.view_anndata_setup(), Cell2Location recognize the GPU:
GPU available: True, used: True
TPU available: False, using: 0 TPU cores
but it does stop just afterwards with the following error:
RuntimeError: cannot pin 'torch.cuda.FloatTensor' only dense CPU tensors can be pinned
.
I saw that it should be easily overcome if I can put pin_memory=False
(see here) in cell2location model, how can I do that?
Best, Carlo
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Common errors — cell2location documentation - Read the Docs
Solution: try removing genes detected at low levels in spatial data. 3. Theano fails to use the GPU at all (or cuDNN in...
Read more >cell2location/cell2location_short_demo.ipynb at master - GitHub
This notebook demonstrates how to use the cell2location model for mapping a single cell reference cell types onto a spatial transcriptomic dataset.
Read more >cell2location - Wellcome Sanger Institute
Cell2location maps the spatial distribution of cell types by integrating single-cell RNA-seq (scRNA-seq) and multi-cell spatial transcriptomic data from a given ...
Read more >Vitalii Kleshchevnikov on Twitter: "My 1st paper out in ...
Tons of new work showing that we can resolve fine cell types in spatial ... We present 1) cell2location method, 2) show how...
Read more >Mapping human lymph node cell types to 10X Visium with ...
Cell2location is a principled Bayesian model that estimates which combination of cell types in which cell abundance could have given the mRNA counts...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yes it works smoothly!
Update: I tried to re-create another conda environment following the C2L installation tutorial to see if I could overcome this error, and indeed I succeed. the previous error vanishes and it starts the training of the model using GPU. I report here the list of correct packages for future reference:
Best, Carlo