stack expects each tensor to be equal size, but got [1, 3, 64] at entry 0 and [1, 3, 142] at entry 1
时间: 2024-02-10 16:00:46 浏览: 151
STACK1_SEGMENT_STACK.rar_STACK1 SEGMENT_stack segment stack
5星 · 资源好评率100%
This error message indicates that there are two tensors being stacked together using the `torch.stack()` function, but they have different sizes along one of their dimensions. Specifically, the tensors have shapes `[1, 3, 64]` and `[1, 3, 142]`.
To fix this error, you need to ensure that the tensors being stacked have the same size along the dimension you want to stack them along. You can either reshape the tensors to have the same size or pad the smaller tensor with zeros to match the larger tensor's size. Once the tensors have the same size, you can stack them using `torch.stack()`.
阅读全文