Commit 2707a129 authored by Cresson Remi's avatar Cresson Remi

WIP: migrade python codes from TF1.X --> TF2.X

parent 8cc0e197
......@@ -53,8 +53,7 @@ def my_model(x1, x2):
activation=tf.nn.relu) # out size: 1x1x64
# Stack features
features = tf.reshape(tf.stack([conv3_x1, conv4_x2], axis=3),
shape=[-1, 128], name="features")
features = tf.reshape(tf.stack([conv3_x1, conv4_x2], axis=3), shape=[-1, 128], name="features")
# 8 neurons for 8 classes
estimated = tf.compat.v1.layers.dense(inputs=features, units=params.nclasses, activation=None)
......@@ -69,8 +68,7 @@ with tf.compat.v1.Graph().as_default():
x1 = tf.compat.v1.placeholder(tf.float32, [None, None, None, 4], name="x1")
x2 = tf.compat.v1.placeholder(tf.float32, [None, None, None, 1], name="x2")
y = tf.compat.v1.placeholder(tf.int32, [None, None, None, 1], name="y")
lr = tf.compat.v1.placeholder_with_default(tf.constant(0.0002, dtype=tf.float32, shape=[]),
shape=[], name="lr")
lr = tf.compat.v1.placeholder_with_default(tf.constant(0.0002, dtype=tf.float32, shape=[]), shape=[], name="lr")
# Output
y_estimated, y_label = my_model(x1, x2)
......
......@@ -71,7 +71,6 @@ def create_savedmodel(sess, inputs, outputs, directory):
outputs_names = {o: graph.get_tensor_by_name(o) for o in outputs}
tf.compat.v1.saved_model.simple_save(sess, directory, inputs=inputs_names, outputs=outputs_names)
def ckpt_to_savedmodel(ckpt_path, inputs, outputs, savedmodel_path, clear_devices=False):
"""
Read a Checkpoint and build a SavedModel
......
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