Why do some imports from the TensorFlow library have inconsistent capitalisation?

Before fixing:
from tensorflow.python.keras.engine import Sequential ~~ doesn’t work
from tensorflow.python.keras.layers import Dense ~~ works
from tensorflow.python.keras.optimizer_v2 import Adam ~~ doesn’t work

After:
from tensorflow.python.keras.engine import sequential
from tensorflow.python.keras.layers import Dense
from tensorflow.python.keras.optimizer_v2 import adam

two letters took me at least a month to figure out.

Hi @Masashi, tensorflow/python/keras code is a legacy copy of Keras since the TensorFlow v2.7 release, and was deleted in the from v2.12. Please remove any import of tensorflow.python.keras and use the public API with from tensorflow import keras or import tensorflow as tf; tf.keras. Thank You.