if i change the nn.BCEWithLogitsLoss to nn.BCELoss function error was:

RuntimeError: the derivative for ‘target’ is not implemented

but remove nn.Sigmoid and leave BCEWithLogitsLoss there is no error occured