Hi Sally!



 Sally_Goldin:

        print('loss is %d' % (loss))

Why is the loss always zero?


This is a python issue, rather than anything specific to pytorch.
%d formats your value as an integer, truncating any fractional part.
By construction, assuming that your labels are between 0 and 1,
your loss will (almost) always be less than one and be truncated
to zero.
That is, MSELoss is not producing 0, but you’re printing it out as 0.
Best.
K. Frank