googlecodelabs / tensorflow-for-poets-2

Apache License 2.0
508 stars 463 forks source link

Modifications in evaluate.py for other architectures (KeyError: "The name 'final_training_ops/Wx_plus_b/add:0' refers to a Tensor which does not exist.) #63

Closed sumanth-culli closed 6 years ago

sumanth-culli commented 6 years ago

There's another script for training as mentioned in hub/examples/image_retraining/retrain.py. So when I used that script for training after some modifications, how should I modify the line 41 in evaluate.pylogits = graph.get_tensor_by_name("final_training_ops/Wx_plus_b/add:0"). I'm getting KeyError: "The name 'final_training_ops/Wx_plus_b/add:0' refers to a Tensor which does not exist. The operation, 'final_training_ops/Wx_plus_b/add', does not exist in the graph."

sumanth-culli commented 6 years ago

I figured this out myself. Given a .pb file, we can view the operations in frozen .pb TensorFlow graphs using this code. So, we need to replace the line 41 with the last operation according to our .pb file.