()
Load non-coverage checkpoint, add initialized extra variables for coverage, and save as new checkpoint
Load non-coverage checkpoint, add initialized extra variables for coverage, and save as new checkpoint
Load non - coverage checkpoint add initialized extra variables for coverage and save as new checkpoint
def convert_to_coverage_model():
  """Load non-coverage checkpoint, add initialized extra variables for coverage, and save as new checkpoint"""
  tf.logging.info("converting non-coverage model to coverage model..")

  # initialize an entire coverage model from scratch
  sess = tf.Session(config=util.get_config())
  print "initializing everything..."
  sess.run(tf.global_variables_initializer())

  # load all non-coverage weights from checkpoint
  saver = tf.train.Saver([v for v in tf.global_variables() if "coverage" not in v.name and "Adagrad" not in v.name])
  print "restoring non-coverage variables..."
  curr_ckpt = util.load_ckpt(saver, sess)
  print "restored."

  # save this model and quit
  new_fname = curr_ckpt + '_cov_init'
  print "saving model to %s..." % (new_fname)
  new_saver = tf.train.Saver() # this one will save all variables that now exist
  new_saver.save(sess, new_fname)
  print "saved."
  exit()
def convert_to_coverage_model ( ) : tf . logging . info ( "converting non-coverage model to coverage model.." ) # initialize an entire coverage model from scratch sess = tf . Session ( config = util . get_config ( ) ) print "initializing everything..." sess . run ( tf . global_variables_initializer ( ) ) # load all non-coverage weights from checkpoint saver = tf . train . Saver ( [ v for v in tf . global_variables ( ) if "coverage" not in v . name and "Adagrad" not in v . name ] ) print "restoring non-coverage variables..." curr_ckpt = util . load_ckpt ( saver , sess ) print "restored." # save this model and quit new_fname = curr_ckpt + '_cov_init' print "saving model to %s..." % ( new_fname ) new_saver = tf . train . Saver ( ) # this one will save all variables that now exist new_saver . save ( sess , new_fname ) print "saved." exit ( )