Open PaulineMoulle opened 2 years ago
Hi ,
The step full.sequential().get_latent()
is getting the latent layer after the training for joint-seq dataset.
I am not sure whether the step of rna+atac dataset loading, and the step of training is correct? The final ValueError report might indicate missing of one dimension(rna or atac) in the anndata format parameter dataset
.
Can you check the input step?
Hi,
I got the similar ValueError when following the scripts in 10x_pbmc_demo.ipynb. An error happens in trainer.train(n_epochs=15, lr=lr)
. Do you have any idea to fix it?
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/data/jliu25/scMVP/scMVP/inference/trainer.py", line 159, in train
loss = self.loss(*tensors_list)
File "/data/jliu25/scMVP/scMVP/inference/multi_inference.py", line 515, in loss
sample_batch_X, sample_batch_Y, local_l_mean, local_l_var, batch_index, batch_index
File "/data/jliu25/anaconda3/envs/py37/lib/python3.7/site-packages/torch-1.12.0-py3.7-linux-x86_64.egg/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/data/jliu25/scMVP/scMVP/models/multi_vae_attention.py", line 508, in forward
outputs = self.inference(x, batch_index, y, local_l_mean, local_l_var, update=False)
File "/data/jliu25/scMVP/scMVP/models/multi_vae_attention.py", line 389, in inference
qz_m, qz_v, z = self.RNA_ATAC_encoder([x_rna, x_atac], batch_index)
File "/data/jliu25/anaconda3/envs/py37/lib/python3.7/site-packages/torch-1.12.0-py3.7-linux-x86_64.egg/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/data/jliu25/scMVP/scMVP/models/modules.py", line 906, in forward
latent = reparameterize_gaussian(q_m, q_v)
File "/data/jliu25/scMVP/scMVP/models/modules.py", line 13, in reparameterize_gaussian
return Normal(mu, var.sqrt()).rsample()
File "/data/jliu25/anaconda3/envs/py37/lib/python3.7/site-packages/torch-1.12.0-py3.7-linux-x86_64.egg/torch/distributions/normal.py", line 54, in __init__
super(Normal, self).__init__(batch_shape, validate_args=validate_args)
File "/data/jliu25/anaconda3/envs/py37/lib/python3.7/site-packages/torch-1.12.0-py3.7-linux-x86_64.egg/torch/distributions/distribution.py", line 56, in __init__
f"Expected parameter {param} "
ValueError: Expected parameter loc (Tensor of shape (64, 20)) of distribution Normal(loc: torch.Size([64, 20]), scale: torch.Size([64, 20])) 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>)
@LiuJJ0327 Hi, Thank you for your report! I rerun the 10x pbmc demo on CUDA10 and CUDA11 server, but could not reproduce your the error.
Could you first check the input file by dataset.atac_expression
for atac and dataset.X
for rna?
Also, the 10x pbmc demo requires ~30G memory and 2G GPU on our server. Does the task exceed the resource limit on your computer?
Hi, thank you for your work first. I'm trying to run the model on another scRNA+scATAC-seq dataset following the steps in the 10x_pbmc_demo.
First steps correctly running .
But i have this error for this command
I would greatly appreciate any advice on how to handle this - many thanks in advance!