How to resolve runtime error due to size mismatch in PyTorch?

前端 未结 3 1106
被撕碎了的回忆
被撕碎了的回忆 2021-02-06 04:54

I am trying to implement a simple autoencoder using PyTorch. My dataset consists of 256 x 256 x 3 images. I have built a torch.utils.data.dataloader.DataLoade

3条回答
  •  渐次进展
    2021-02-06 05:41

    Whenever you have:

    RuntimeError: size mismatch, m1: [a x b], m2: [c x d]
    

    all you have to care is b=c and you are done:

    m1 is [a x b] which is [batch size x in features]

    m2 is [c x d] which is [in features x out features]

提交回复
热议问题