Solved by ptrblck in post #2 
              
              
                You are using a target tensor as a LongTensor, which is fine for nn.CrossEntropyLoss, but will fail for nn.SmoothL1Loss, so you would have to transform it into a FloatTensor: 
loss = self.weights[0]*self.L1(output[:,0],target[:,0].float())+self.weights[1]*self.CE(output[:,1:3],target[:,1])