Skip to content

Optimized save method #1

Description

@JcmeLs

This is not a issue,but a optimized save method.

  1. import dependency
from tensorflow.python.framework.graph_util import convert_variables_to_constants 
  1. Convert variables to constants and save
output_graph_def = convert_variables_to_constants(sess, sess.graph_def, output_node_names=
['output/outputs'])
    with tf.gfile.FastGFile('model/CTNModel.pb', mode='wb') as f:
        f.write(output_graph_def.SerializeToString())

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions