Based on the stack trace, it seems the error is thrown by Keras (or TensorFlow), so it might be a better idea to create a topic in their GitHub or Stackoverflow.
You might not get the best answer here, as we are focused on PyTorch.