Crash during training: paramter logits has invalid values

You could use something like this for your custom model:

I hope that helps.