In my case, this error is caused because my loss function just receive values between [0, 1], and i was passing other values.
So, normalizing my loss function input, solve this:
    saida_G -= saida_G.min(1, keepdim=True)[0]
    saida_G /= saida_G.max(1, keepdim=True)[0]

Read this: link 63