PyTorch Error: RuntimeError: Sizes of tensors must match except in dimension 2
This error message is raised when trying to perform an operation that requires tensor sizes to match, but they do not match. In this case, the sizes of two tensors do not match except in dimension 2. The offending index is 0, which means that the mismatch occurs in the first dimension.
To fix this error, you need to make sure that the sizes of the tensors match in all dimensions except dimension 2. You can either resize the tensors or use a different operation that works with tensors of different sizes.
原文地址: https://www.cveoy.top/t/topic/m4zU 著作权归作者所有。请勿转载和采集!