The following link help me to get the exact error and now I am able to fix.
gdb python
catch throw
run <script name>
backtrace




 alextheoldgreyhorse:

Hi all, I observe the same.  it occurs in loss backward, if the batchsize at the end of the dataloader sampling becomes 1:  loss torch.Size([1]) torch.Size([64, 3, 256, 256]) torch.Size([64, 1])  loss torch.Size([1]) torch.Size([64, 3, 256, 256]) torch.Size([64, 1])  loss torch.Size([1]) torch.Size([64, 3, 256, 256]) torch.Size([64, 1])  loss torch.Size([1]) torch.Size([64, 3, 256, 256]) torch.Size([64, 1])  loss torch.Size([1]) torch.Size([64, 3, 256, 256]) torch.Size([64, 1])  loss torch.Size(…


Thanks.