0

So I am new to Keras and Tensorflow. I'm trying to import the img_to_array function and for some reason it is not importing it. I read the documentation it says from PIL import Image and after that use tf.keras.preprocessing.image.img_to_array(img) and that doesn't work either. I am using anaconda.

Here's the code:

from keras.preprocessing.image import img_to_array

And here's the error:

AttributeError: module 'tensorflow' has no attribute 'name_scope'
7
  • Does this answer your question? AttributeError: module 'tensorflow' has no attribute 'name_scope' with Keras Commented Jun 25, 2020 at 19:08
  • Which version of keras and tensorflow are you using? Commented Jun 25, 2020 at 19:26
  • I'm using Tensorflow 2.1.0 and Version 2.3.1 of Keras. Commented Jun 26, 2020 at 17:43
  • @Liorr I looked at that but no luck..... Commented Jun 26, 2020 at 17:43
  • @Hamza Even the second (not accepted) answer? Commented Jun 26, 2020 at 17:49

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.