vsoch / boneage

A django application to demo a bone age prediction model

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"input_image" placeholder not found in graph

nishithbsk opened this issue · comments

Hi Vanessa and Matt,

I'm trying to run a forward pass on the network after loading in the meta and checkpoint files. To do so, I need to construct a feed_dict containing input_image (as defined here). However, I'm unable to find the placeholder input_image in the graph. Any thoughts?

Steps to reproduce:

import tensorflow as tf
saver = tf.train.import_meta_graph("./bone-age-checkpoint.ckpt-19999.meta")
graph = tf.get_default_graph()
nodes = graph.as_graph_def().node # this returns a list of all nodes in the graph
for node in nodes:
    if "input_image" in node.name:
       print node # it never reaches here

Thanks a lot for the help!

I can't comment because I didn't make the original model, but I think @mchen17 might have some insight.

I suspect it is an issue with reconstructing the graph using the meta file. This looks like a similar problem

https://stackoverflow.com/questions/44251328/tensorflow-print-all-placeholder-variable-names-from-meta-graph

You might have better luck just reconstructing the graph with the given code and using saver to restore the weights once the computational graph has been initialized.

Thanks @mchen17 and @vsoch. Upgrading some functions to TF 1.0+ and saving the meta graph again resolved this issue!