satijalab / seurat-wrappers

Community-provided extensions to Seurat
GNU General Public License v3.0
305 stars 131 forks source link

ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 128]) #200

Open zclecle2 opened 1 month ago

zclecle2 commented 1 month ago

Hi, Really thank you for providing scvi tool in seurat environment. I recently happened to a problem:

Weixin Image_20240920003733

I checked online, and found that there seems to be a solution: https://github.com/scverse/scvi-tools/issues/2314 "Hi, this unfortunately occurs when the last batch of the training set contains one observation, leading to the batch norm layer complaining. You can solve this by passing in a batch_size to the train method that is different than the default one."

However, in seurat-wrapppers function (```

' obj <- IntegrateLayers(object = obj, method = scVIIntegration,

' orig.reduction = "pca", new.reduction = 'integrated.scvi',

' assay = "SCT", conda_env = '../miniconda3/envs/scvi-env', verbose = FALSE).

``), I can't modify the parameters provided to thetrain` method. Could you please help with this problem? Many thanks!

hannatadros93 commented 1 month ago

second this question^^