RuntimeError: mat1 and mat2 shapes cannot be multiplied (5x100352 and 2048x512)
时间: 2024-01-22 13:57:56 浏览: 121
RuntimeError: Cannot run the event loop while another loop is running(目前没有解决)
5星 · 资源好评率100%
This error occurs when attempting to multiply two matrices with incompatible dimensions. Specifically, the number of columns in the first matrix (mat1) must match the number of rows in the second matrix (mat2).
In this case, mat1 is a matrix with 5 rows and 100352 columns, while mat2 is a matrix with 2048 rows and 512 columns. Since the number of columns in mat1 does not match the number of rows in mat2, they cannot be multiplied together.
To fix this error, either reshape the matrices so that their dimensions are compatible for multiplication, or use a different operation that is valid for the given dimensions.
阅读全文