That error is gone!! thank you so much!! however, now I have this error:
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-58-3b352c3bae56> in <module>()
     38 
     39 
---> 40           loss = criterion(output, target) #+ 0.4*criterion2(output, mask)  + 0.2*criterion3(output, mask)
     41 
     42           if phase=='train':

2 frames
/usr/local/lib/python3.6/dist-packages/torch/nn/functional.py in binary_cross_entropy(input, target, weight, size_average, reduce, reduction)
   2482 
   2483     return torch._C._nn.binary_cross_entropy(
-> 2484         input, target, weight, reduction_enum)
   2485 
   2486 

RuntimeError: Found dtype Long but expected Float

I tried to convert the target to float but it didn’t work