我tensorflow模型如下:如何保存tensorflow模型(省略標籤張量),沒有定義
X = tf.placeholder(tf.float32, [None,training_set.shape[1]],name = 'X')
Y = tf.placeholder(tf.float32,[None,training_labels.shape[1]], name = 'Y')
A1 = tf.contrib.layers.fully_connected(X, num_outputs = 50, activation_fn = tf.nn.relu)
A1 = tf.nn.dropout(A1, 0.8)
A2 = tf.contrib.layers.fully_connected(A1, num_outputs = 2, activation_fn = None)
cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(logits = A2, labels = Y))
global_step = tf.Variable(0, trainable=False)
start_learning_rate = 0.001
learning_rate = tf.train.exponential_decay(start_learning_rate, global_step, 200, 0.1, True)
optimizer = tf.train.AdamOptimizer(learning_rate=learning_rate).minimize(cost)
現在我要救這個模型遺漏張Y
(Y
是標籤張量對於培訓,X
是實際的輸入)。同時在提及freeze_graph.py
時提及輸出節點時,我應該提及"A2"
還是以其他名稱保存?
感謝@Maxim的回覆。真的很感謝你的時間。 –