Commit 1709be99 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

marked rv_stage1_out as not trainable - smaller model size

parent 5bc70b70
......@@ -138,6 +138,7 @@ Probably ResourceVariable is not needed here because of the tf.scatter_update()
If collection is not provided, it defaults to [GraphKeys.GLOBAL_VARIABLES], and that in turn fails saver.restore() as this variable was not available in the trained model
#rv_stage1_out = resource_variable_ops.ResourceVariable(
rv_stage1_out = tf.Variable(
np.zeros([HEIGHT * WIDTH, NN_LAYOUT1[-1]]),
......@@ -145,14 +146,14 @@ rv_stage1_out = tf.Variable(
collections = [GraphKeys.LOCAL_VARIABLES],# Works, available with tf.local_variables()
name = 'rv_stage1_out')
rv_stage1_out = tf.get_variable("rv_stage1_out",
shape=[HEIGHT * WIDTH, NN_LAYOUT1[-1]],
collections = [GraphKeys.LOCAL_VARIABLES],trainable=False)
#rv_stageX_out_init_placeholder = tf.placeholder(tf.float32, shape=[HEIGHT * WIDTH, NN_LAYOUT1[-1]])
#rv_stageX_out_init_op = rv_stageX_out.assign(rv_stageX_out_init_placeholder)
......@@ -273,6 +274,10 @@ with tf.Session() as sess:
that do not have this variable, add it to globals.
Actually it could have been declared right here - this
needs testing.
NOTE: The line below makes the next script's, that saves
a Saved_Model MetaGraph, size of the Saved_Model significantly
tf.add_to_collection(GraphKeys.GLOBAL_VARIABLES, rv_stage1_out)
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