RuntimeError:the derivative for ‘weight’ is not implemented
原因:binary_cross_entropy_with_logits doesn’t support back-propagating through the weight attribute
解决方案:If you don’t need the derivative weight then you can use weight.detach() instead of weight. If you need the derivative, then you’ll having to implement binary_cross_entropy_with_logits yourself.