0

System Info :

  • keras 2.3.1
  • pip 20.2.2
  • python 3.6.10
  • tensorflow 2.3.0

I am working on a siamese algorithm on keras tensorflow backend. I have imported keras backend as follow and it shows above attribute error. What could be the reason for that and how to avoid this issue?

import tensorflow.python.keras.backend as K

AttributeError: module 'tensorflow' has no attribute 'python'

3
  • Does this answer your question? AttributeError: module 'tensorflow' has no attribute 'python' Commented Aug 19, 2020 at 6:51
  • from tensorflow.keras import backend as k . can you try it with this Commented Aug 19, 2020 at 6:55
  • yes i have already tried from tensorflow.keras import backend as k. but it did not worked @gautamrk Commented Aug 19, 2020 at 7:47

1 Answer 1

3

It means that within the module 'tensorflow', no attribute named 'python' exists. You don't really need to import python as a module I believe. Try this:

import tensorflow.keras.backend as K
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.