Trick_2

Save & restore

# save

X = tf.placeholder('float', [None, 4000], name='input_X')
Y = tf.placeholder('float', [None, 2], name='label_Y')
is_training = tf.placeholder(tf.bool, name='is_training')

logits = build_model(is_training, X)
tf.identity(logits, name='output_Y')

# ...

tf.saved_model.simple_save(
    sess,
    save_dir.as_posix(),
    inputs={
        'input_X': X,
        'is_training': is_training
    },
    outputs={'output_Y': logits}
)

Tensorboard

Last updated

Was this helpful?