udacity / deep-learning-v2-pytorch

Projects and exercises for the latest Deep Learning ND program https://www.udacity.com/course/deep-learning-nanodegree--nd101
MIT License
5.26k stars 5.32k forks source link

RuntimeError: mat1 and mat2 shapes cannot be multiplied (3584x7 and 25088x4096) #396

Closed HamdiTarek closed 2 years ago

HamdiTarek commented 2 years ago

I am trying two different images and I am getting this error, this is the size of the two images after loading them: torch.Size([1, 3, 400, 444]) torch.Size([1, 3, 400, 444])

ronny-udacity commented 2 years ago

The error message shows the dimension shapes of the two matrices can't be multiplied. The matrix multiplication requires the shapes to be (m,n) and (n, p),