Hi,
See this other post that is related: Getting None on custom loss function Does that explains your issue?