HI! I am back again and I tried converting my input and target data types to Long and Float respectively. But I got an error again:
IndexError                                Traceback (most recent call last)
<ipython-input-15-0148a2dd2dca> in <module>()
     21   return batch_img_all, batch_mask_all, outputs
     22 
---> 23 IMG, MSK, OUTPUT = train(model)

4 frames
/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py in nll_loss(input, target, weight, size_average, ignore_index, reduce, reduction)
   2264         ret = torch._C._nn.nll_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
   2265     elif dim == 4:
-> 2266         ret = torch._C._nn.nll_loss2d(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
   2267     else:
   2268         # dim == 3 or dim > 4

IndexError: Target 60 is out of bounds.

I suspect the value 60 has something to do with my class indices since I have 60 classes. But I cannot comprehend why it has this error when I already declared my number of classes. Can you help me again? Thank you so much.