Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong size of 'x' in each batch #2

Open
ekernf01 opened this issue Nov 3, 2023 · 0 comments
Open

Wrong size of 'x' in each batch #2

ekernf01 opened this issue Nov 3, 2023 · 0 comments

Comments

@ekernf01
Copy link

ekernf01 commented Nov 3, 2023

Hi scFormer devs, I am seeing an error when testing out the scFormer perturbation prediction demo.

max num of non_zeros_gene_idx: 5012
min num of non_zeros_gene_idx: 4652
mean num of non_zeros_gene_idx: 4944.631578947368
Traceback (most recent call last):
  File "/home/ekernf01/Desktop/jhu/research/projects/perturbation_prediction/cell_type_knowledge_transfer/test_scformer.py", line 45, in <module>
    pt.simple_training()
  File "/home/ekernf01/Desktop/jhu/research/projects/perturbation_prediction/cell_type_knowledge_transfer/scformer_perturb/scformer_perturb.py", line 167, in simple_training
    self.train(
  File "/home/ekernf01/Desktop/jhu/research/projects/perturbation_prediction/cell_type_knowledge_transfer/scformer_perturb/scformer_perturb.py", line 241, in train
    pert_flags = x[:, 1].long().view(batch_size, self.n_genes)
IndexError: index 1 is out of bounds for dimension 1 with size 1

Here are the details on a batch causing this error. It looks like x is too small along axis 1. Can you tell from this what needs to be fixed? Thank you!

DataBatch(x=[161440, 1], y=[32, 5045], pert_idx=[32], de_idx=[32], pert=[32], batch=[161440], ptr=[33])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant