Skip to content

Data Type Error while butterfly.train_model() #2

@qihang-zou

Description

@qihang-zou

Hello,

When I'm following the tutorial of scButterfly-B, while executing butterfly.train_model(), error occurs:

RuntimeError Traceback (most recent call last)
Cell In[13], line 1
----> 1 butterfly.train_model()

File ~/miniconda3/envs/scButterfly_cpu/lib/python3.9/site-packages/scButterfly/butterfly.py:594, in Butterfly.train_model(self, R_encoder_lr, A_encoder_lr, R_decoder_lr, A_decoder_lr, R_translator_lr, A_translator_lr, translator_lr, discriminator_lr, R2R_pretrain_epoch, A2A_pretrain_epoch, lock_encoder_and_decoder, translator_epoch, patience, batch_size, r_loss, a_loss, d_loss, loss_weight, output_path, seed, kl_mean, R_pretrain_kl_warmup, A_pretrain_kl_warmup, translation_kl_warmup, load_model, logging_path)
592 kl_div = R_kl_div + A_kl_div
593 loss_weight.extend([R_kl_div, A_kl_div, kl_div])
--> 594 self.model.train(
595 R_encoder_lr = R_encoder_lr,
596 A_encoder_lr = A_encoder_lr,
597 R_decoder_lr = R_decoder_lr,
598 A_decoder_lr = A_decoder_lr,
599 R_translator_lr = R_translator_lr,
600 A_translator_lr = A_translator_lr,
601 translator_lr = translator_lr,
602 discriminator_lr = discriminator_lr,
603 R2R_pretrain_epoch = R2R_pretrain_epoch,
604 A2A_pretrain_epoch = A2A_pretrain_epoch,
605 lock_encoder_and_decoder = lock_encoder_and_decoder,
606 translator_epoch = translator_epoch,
607 patience = patience,
608 batch_size = batch_size,
609 r_loss = r_loss,
610 a_loss = a_loss,
...
File ~/miniconda3/envs/scButterfly_cpu/lib/python3.9/site-packages/torch/nn/modules/linear.py:114, in Linear.forward(self, input)
113 def forward(self, input: Tensor) -> Tensor:
--> 114 return F.linear(input, self.weight, self.bias)

RuntimeError: expected scalar type Float but found Double

Looking for your help, thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions