Really thank you that helped me,
But there still persists this error i wrote above.
I also used this:
print(result.shape,outputFromNetwork.shape)
loss = criterion(result,outputFromNetwork)

and get this:
torch.Size([1, 3, 400, 200]) torch.Size([1, 400, 200])
and then while using critterion i get error mentioned above.
Am i doing something wrong with dimensions, or with cuda, or something else? I really do not know what am i doing wrong.