'Variable type field must be a TensorType.' error when running cell2location
See original GitHub issueHi,
I’ve followed the tutorial, however I’m stack during the last part of 2/3. When I run the code above, I get an error.
os.environ["THEANO_FLAGS"] = 'device=cpu,floatX=float32,openmp=True,force_device=True'
r = cell2location.run_cell2location(
# Single cell reference signatures as pd.DataFrame
# (could also be data as anndata object for estimating signatures
# as cluster average expression - `sc_data=adata_snrna_raw`)
sc_data=inf_aver,
# Spatial data as anndata object
sp_data=adata_vis,
# the column in sc_data.obs that gives cluster idenitity of each cell
summ_sc_data_args={'cluster_col': "TaxonomyRank4",
# select marker genes of cell types by specificity of their expression signatures
'selection': "cluster_specificity",
# specificity cutoff (1 = max, 0 = min)
'selection_specificity': 0.5
},
train_args={'use_raw': True, # By default uses raw slots in both of the input datasets.
'n_iter': 40000, # Increase the number of iterations if needed (see QC below)
# Whe analysing the data that contains multiple experiments,
# cell2location automatically enters the mode which pools information across experiments
'sample_name_col': 'sample'}, # Column in sp_data.obs with experiment ID (see above)
export_args={'path': data_dir + 'cell2location_model/'
}
)
And the error what I get is:
### Summarising single cell clusters ###
### Creating model ### - time 0.0 min
Traceback (most recent call last):
File "run_cell2location.py", line 191, in <module>
export_args={'path': data_dir + 'cell2location_model/'
File "/home/tsztank/miniconda3/envs/cellpymc/lib/python3.7/site-packages/cell2location/run_c2l.py", line 345, in run_cell2location
**model_kwargs)
File "/home/tsztank/miniconda3/envs/cellpymc/lib/python3.7/site-packages/cell2location/models/LocationModelLinearDependentWMultiExperiment.py", line 278, in __init__
total_size=self.X_data.shape)
File "/home/tsztank/miniconda3/envs/cellpymc/lib/python3.7/site-packages/pymc3/distributions/distribution.py", line 83, in __new__
return model.Var(name, dist, data, total_size, dims=dims)
File "/home/tsztank/miniconda3/envs/cellpymc/lib/python3.7/site-packages/pymc3/model.py", line 1117, in Var
model=self,
File "/home/tsztank/miniconda3/envs/cellpymc/lib/python3.7/site-packages/pymc3/model.py", line 1737, in __init__
data = as_tensor(data, name, model, distribution)
File "/home/tsztank/miniconda3/envs/cellpymc/lib/python3.7/site-packages/pymc3/model.py", line 1691, in as_tensor
data = tt.as_tensor_variable(data, name=name)
File "/home/tsztank/miniconda3/envs/cellpymc/lib/python3.7/site-packages/theano/tensor/basic.py", line 158, in as_tensor_variable
"Variable type field must be a TensorType.", x, x.type)
theano.tensor.var.AsTensorError: ('Variable type field must be a TensorType.', SparseVariable{csr,int16}, Sparse[int16, csr])
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Common errors — cell2location documentation - Read the Docs
Solution: use our singularity and docker images with CUDA 10.2. B. The single cell reference is a very poor match to the data...
Read more >Cell2location overview and validation using simulated data a ...
Cell2location takes reference cell type signatures derived from scRNA-seq and spatial transcriptomics data as input. The model then decomposes spatially ...
Read more >Comprehensive mapping of tissue architecture via ... - YouTube
Speaker: Omer Bayraktar, Wellcome Sanger InstituteVirtual seminar series for Spatial Omics, organized by Prof. Rong Fan and Prof.
Read more >Comprehensive mapping of tissue cell architecture ... - bioRxiv
multi-cell spatial transcriptomic data into cell type abundance maps. ... When using cell2location to map these cell types to the.
Read more >cell2location - PyPI
cell2location : High-throughput spatial mapping of cell types. ... type reference signatures and spatial transcriptomics data as input (2, ...
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
Hi, I am trying to run through th whole tutorial of cell2location on the data provided by the tutorial before trying it on my own data. I however, encounter problems when arriving at running the actual model. when running:
I encounter following error, the same type as mentioned above:
I run the model on an ‘old’ titan X GPU, as newer GPU’s don’t support theano anymore. I installed the package yesterday, based on the environment.yml file provided, and then using the github as mentioned by you.
However, I encountered a problem with the arviz package. When loading the package in python, I received following error: module ‘arviz’ has no attribute ‘geweke’ For this reason, I installed arviz version 0.10.0 instead of 0.11.2. This made it possible to load the package into python. If necessary, I can send more information, but I just followed all provided steps.
@onahman Setting GPU shouldn’t be too hard, we have a short guide about it here. The only potential issue is that it does require root access, is it a problem for you?