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

**URL:** <https://discuss.ai.google.dev/t/why-do-some-imports-from-the-tensorflow-library-have-inconsistent-capitalisation/49059>\
**Category:** TensorFlow\
**Tags:** issues, tfkeras, python-library\
**Created:** [November 13, 2024, 3:35am UTC](https://discuss.ai.google.dev/t/why-do-some-imports-from-the-tensorflow-library-have-inconsistent-capitalisation/49059 "2024-11-13T03:35:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Masashi](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/masashi/32/29286_2.png) [@Masashi](https://discuss.ai.google.dev/u/Masashi)\
**Post date:** [November 13, 2024, 3:35am UTC](https://discuss.ai.google.dev/t/why-do-some-imports-from-the-tensorflow-library-have-inconsistent-capitalisation/49059/1 "2024-11-13T03:35:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kiran\_Sai\_Ramineni](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/kiran_sai_ramineni/32/8859_2.png) [@Kiran\_Sai\_Ramineni](https://discuss.ai.google.dev/u/Kiran_Sai_Ramineni)\
**Post date:** [November 13, 2024, 4:48am UTC](https://discuss.ai.google.dev/t/why-do-some-imports-from-the-tensorflow-library-have-inconsistent-capitalisation/49059/3 "2024-11-13T04:48:42Z")

</div>

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.
