0

Importing from Keras:

from keras.preprocessing.sequence import pad_sequences

gives an error:

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

I'm using MacOs/Anaconda/Python 3.6:

Keras 2.2.4,
Keras-Applications 1.0.6,
Keras-Preprocessing 1.0.5,
tensorflow 1.12.0,

i've read this thread - doesn't help ((( tried reinstall Anaconda - no effect. But i have some clue, maybe problem connected with Python version?

python --version

gives 3.6.8, but in Anaconda3/lib/ only Python3.7

2
  • 2
    Please include the full backtrace. Did you name any of your scripts as tensorflow.py? Commented Mar 5, 2019 at 15:47
  • Please check in Latest version and also make sure that there is no custom built tensorflow.py file in your folder. Reference - stackoverflow.com/questions/57545273/… Commented Sep 2, 2021 at 2:59

0

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.