I think the error is pointing out that the span of x is not between 0 and 1.
Because, target needs to be either 0 or 1, in your case, the variable x in F.binary_crossentropy().
Could you check what’s the min and max value of  x before you pass it to the loss function ?
And can you paste the error ?