for example if you have ;
input= torch.rand([0,1,1,66650])
m=nn.MaxPool2d(1,110)
output=m(input1)
why do i get the following error?
RuntimeError: non-empty 3D or 4D input tensor expected but got ndim: 4
for example if you have ;
input= torch.rand([0,1,1,66650])
m=nn.MaxPool2d(1,110)
output=m(input1)
why do i get the following error?
RuntimeError: non-empty 3D or 4D input tensor expected but got ndim: 4
You are creating an empty tensor in:
input = torch.rand([0,1,1,66650])
print(input)
> tensor([], size=(0, 1, 1, 66650))
by setting the size of dim0
to zero.
As the error message suggests, a non-empty tensor would be required.
thank you. but in my case i was being stupid to feed my network with more data then required number of batches while iterating. so this error kept coming.