Skip to content

出现报错RuntimeError: mat1 and mat2 shapes cannot be multiplied (57x215296 and 256x100),不知道是什么问题,向您请教。 #1

@langer-zheng

Description

@langer-zheng

您好,感谢您分享的代码!
我在使用自己的训练集运行的时候,出现一下问题,请教您如何解决,谢谢。
100%|██████████| 57/57 [00:00<00:00, 491.31it/s]
0%| | 0/100 [00:00<?, ?it/s]
Traceback (most recent call last):

File "C:\code\WGAN_GP\train_for_vae.py", line 367, in
trainer.train(num_epochs=100,

File "C:\code\WGAN_GP\train_for_vae.py", line 151, in train
recon_loss, kl_diverge = self.compute_batch(batch)

File "C:\code\WGAN_GP\train_for_vae.py", line 196, in compute_batch
outputs, mu, log_var = self.model(images)

File "C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)

File "C:\code\WGAN_GP\train_for_vae.py", line 88, in forward
mu, log_var = self.encoder(x)

File "C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)

File "C:\code\WGAN_GP\model\vaemodel.py", line 99, in forward
mu, log_var = self.mu(outputs), self.log_var(outputs)

File "C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)

File "C:\ProgramData\Anaconda3\lib\site-packages\torch\nn\modules\linear.py", line 103, in forward
return F.linear(input, self.weight, self.bias)

RuntimeError: mat1 and mat2 shapes cannot be multiplied (57x215296 and 256x100)

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