# RuntimeError: size mismatch, m1: \[512 x 4\], m2: \[2048 x 512\]

**URL:** <https://discuss.pytorch.org/t/runtimeerror-size-mismatch-m1-512-x-4-m2-2048-x-512/87085>\
**Category:** Uncategorized\
**Created:** [June 27, 2020, 6:24am UTC](https://discuss.pytorch.org/t/runtimeerror-size-mismatch-m1-512-x-4-m2-2048-x-512/87085 "2020-06-27T06:24:32Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![harsha\_g](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/h/4491bb/32.png) [@harsha\_g](https://discuss.pytorch.org/u/harsha_g)\
**Post date:** [June 28, 2020, 6:42am UTC](https://discuss.pytorch.org/t/runtimeerror-size-mismatch-m1-512-x-4-m2-2048-x-512/87085/6 "2020-06-28T06:42:47Z")

</div>

`nn.Flatten()` is part of PyTorch 1.2.0 and later. Either update your pytorch version or you may have to find alternate ways of doing that. More on that here [Flatten layer of PyTorch build by sequential container](https://discuss.pytorch.org/t/flatten-layer-of-pytorch-build-by-sequential-container/5983)

---

_[View the full topic](https://discuss.pytorch.org/t/runtimeerror-size-mismatch-m1-512-x-4-m2-2048-x-512/87085)._
