There are no error message but the problem in the printed loss values:
(I have modified the size of the net)
NetDSpace (
(conv1): Conv2d(1, 6, kernel_size=(3, 3), stride=(1, 1))
(pool): MaxPool2d (size=(2, 2), stride=(2, 2), dilation=(1, 1))
(conv2): Conv2d(6, 16, kernel_size=(3, 3), stride=(1, 1))
(fc1): Linear (144 -> 120)
(fc2): Linear (120 -> 84)
(fc3): Linear (84 -> 10)
)

Average IOU during train Reg0 , epoch 0  is Variable containing:
0.2594
[torch.FloatTensor of size 1]

Average IOU during train Reg0 , epoch 1  is Variable containing:
0.3301
[torch.FloatTensor of size 1]

Average IOU during train Reg0 , epoch 2  is Variable containing:
nan
[torch.FloatTensor of size 1]

Average IOU during train Reg0 , epoch 3  is Variable containing:
nan
[torch.FloatTensor of size 1]

Average IOU during train Reg0 , epoch 4  is Variable containing:
nan
[torch.FloatTensor of size 1]