Hello All,
I am working on labeling the transfer dataset using scANVI, where the reference file contains 460,000 cells, and the query file contains 656,000 cells, both from the same brain region. The reference dataset comprises 65 cell types, and I expect the same cell types in the query data. Our goal is to transfer labels from the reference to the query data. However, I am encountering an error message during the prediction process.
version scvi-tools: scvi-tools 1.0.0
Code:
lvae=scvi.model.SCANVI.from_scvi_model(vae,adata=adata,unlabeled_category = "Unknown", labels_key = name_of_the_new_col,linear_classifier=True) lvae.train(max_epochs=200,n_samples_per_label=1000)
ValueError: Expected parameter loc (Tensor of shape (128, 30)) of distribution Normal(loc: torch.Size([128, 30]), scale: torch.Size([128, 30])) to satisfy the constraint Real(), but found invalid values:
tensor([[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
...,
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan]], device='cuda:0',
grad_fn=<AddmmBackward0>)
But there is no NAN values in .obs or .var in anndata
Please help me to address this. Do i need to tweak the n_samples_per_label?
Thanks
Akila