Commit 7b425da0 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev
Browse files

1. back to trainable=false for rv_stage1_out

2. using main_op=tf.initialize_local_variables() when saving with builder.add_meta_graph_and_variables
parent 1709be99
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -275,11 +275,15 @@ with tf.Session() as sess:
        Actually it could have been declared right here - this
        needs testing.
        
        NOTE: The line below makes the next script's, that saves 
        NOTE1: The line below makes the next script's, that saves 
        a Saved_Model MetaGraph, size of the Saved_Model significantly 
        bigger.
        
        NOTE2: The line below  is commented in favor of (in the next script!):
            builder.add_meta_graph_and_variables(sess,[tf.saved_model.tag_constants.SERVING],main_op=tf.local_variables_initializer()) 
    '''
    tf.add_to_collection(GraphKeys.GLOBAL_VARIABLES, rv_stage1_out)
    #tf.add_to_collection(GraphKeys.GLOBAL_VARIABLES, rv_stage1_out)
    
    
    saver.save(sess, files["inference"])
      
+2 −1
Original line number Diff line number Diff line
@@ -227,7 +227,8 @@ with tf.Session() as sess:
    shutil.rmtree(dirs['exportdir'], ignore_errors=True)
    # save MetaGraph to Saved_Model as *.pb
    builder = tf.saved_model.builder.SavedModelBuilder(dirs['exportdir'])
    builder.add_meta_graph_and_variables(sess,[tf.saved_model.tag_constants.SERVING])
    builder.add_meta_graph_and_variables(sess,[tf.saved_model.tag_constants.SERVING],main_op=tf.local_variables_initializer())
    #builder.add_meta_graph_and_variables(sess,[tf.saved_model.tag_constants.SERVING])
    #builder.save(True)
    builder.save(False) # True = *.pbtxt, False = *.pb