Commit ac2fa1bc authored by Yuxin Wu's avatar Yuxin Wu

When loading from metagraph, only print warning about missing collections. (fix #279)

parent ba295622
...@@ -169,8 +169,8 @@ class ModelFromMetaGraph(ModelDesc): ...@@ -169,8 +169,8 @@ class ModelFromMetaGraph(ModelDesc):
all_coll = tf.get_default_graph().get_all_collection_keys() all_coll = tf.get_default_graph().get_all_collection_keys()
for k in [INPUTS_KEY, tf.GraphKeys.TRAINABLE_VARIABLES, for k in [INPUTS_KEY, tf.GraphKeys.TRAINABLE_VARIABLES,
tf.GraphKeys.GLOBAL_VARIABLES]: tf.GraphKeys.GLOBAL_VARIABLES]:
assert k in all_coll, \ if k not in all_coll:
"Collection {} not found in metagraph!".format(k) logger.warn("Collection {} not found in metagraph!".format(k))
def _get_inputs(self): def _get_inputs(self):
col = tf.get_collection(INPUTS_KEY) col = tf.get_collection(INPUTS_KEY)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment