googlecodelabs / tensorflow-for-poets-2

Apache License 2.0
509 stars 463 forks source link

scripts.label_image tensorflow 2.0 #120

Open MehmetCeylanV opened 5 years ago

MehmetCeylanV commented 5 years ago

Hi;

When i want to run label_image with tensorflow 2.0 , i am getting bellow error message. I have upgrade code by using method at https://www.tensorflow.org/alpha/guide/upgrade .

The Session graph is empty. Add operations to the graph before calling run().

Help me pls. I am newbie at tensorflow and python. Regards

LowSkillDeveloper commented 4 years ago

Try change

import tensorflow as tf

to

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

in the label_image.py