New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tensorflow Error While Classifying the image #3

Open
anujchampjain opened this Issue Sep 5, 2017 · 6 comments

Comments

Projects
None yet
8 participants
@anujchampjain
Copy link

anujchampjain commented Sep 5, 2017

Anujs-iMac:tensorflow-for-poets-2 anujchampjain$ python scripts/label_image.py --graph=tf_files/retrained_graph.pb --image=tf_files/flower_photos/daisy/21652746_cc379e0eea_m.jpg
2017-09-05 12:36:52.419514: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-05 12:36:52.419532: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-09-05 12:36:52.419558: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-09-05 12:36:52.419561: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
Traceback (most recent call last):
File "scripts/label_image.py", line 120, in
input_operation = graph.get_operation_by_name(input_name);
File "/Users/anujchampjain/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2836, in get_operation_by_name
return self.as_graph_element(name, allow_tensor=False, allow_operation=True)
File "/Users/anujchampjain/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2708, in as_graph_element
return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
File "/Users/anujchampjain/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2768, in _as_graph_element_locked
"graph." % repr(name))
KeyError: "The name 'import/input' refers to an Operation not in the graph."

@ikumo

This comment has been minimized.

Copy link

ikumo commented Sep 14, 2017

I got the same error..

@Alzheimancer

This comment has been minimized.

Copy link

Alzheimancer commented Sep 19, 2017

same as me. It seem like a new bug.

@epreble

This comment has been minimized.

Copy link

epreble commented Sep 24, 2017

I edited label_image.py as follows, and got mine working again:

Changed:

input_height = 224
input_width = 224
input_mean = 128
input_std = 128
input_layer = "input"

To:

input_height = 299
input_width = 299
input_mean = 0
input_std = 255
input_layer = "Mul"
  • The change of "input" to "Mul" was suggested here:
    tensorflow/tensorflow#12736
  • The change of the 4 numbers was made in commit 45767a9, on Aug 24, so I changed those back to the original values.

@MarkDaoust MarkDaoust self-assigned this Nov 21, 2017

@MauryaRitesh

This comment has been minimized.

Copy link

MauryaRitesh commented Dec 28, 2017

@epreble you are right and now that worked for me!
Thanks a lot!

@Sagarsharma4244

This comment has been minimized.

Copy link

Sagarsharma4244 commented Jan 20, 2018

Thanks, it worked for me. If it is not working someone that means you need to update your Tensorflow, mine is version 1.4 and do the above changes. Also, the new command for the new version uses argument "python label_image.py --image.py Images.png". I think we can close it now.

@priyanshAgarwal

This comment has been minimized.

Copy link

priyanshAgarwal commented Feb 26, 2018

@epreble Thanks for the info, Can you tell me what thus this change mean?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment