From b3df4da74838327595828fe9ad3775754f388a69 Mon Sep 17 00:00:00 2001 From: yulianfei Date: Mon, 27 Feb 2017 15:20:47 +0800 Subject: [PATCH] [Fix] Upgrade for tensorflow 1.0 with tf_upgrade.py --- dense_classifier.py | 8 ++++---- sparse_classifier.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dense_classifier.py b/dense_classifier.py index b10a2e2..7015111 100755 --- a/dense_classifier.py +++ b/dense_classifier.py @@ -323,8 +323,8 @@ def inference(inputs, is_train=True): sparse_labels = tf.reshape(batch_labels, [-1, 1]) derived_size = tf.shape(batch_labels)[0] indices = tf.reshape(tf.range(0, derived_size, 1), [-1, 1]) - concated = tf.concat(concat_dim=1, values=[indices, sparse_labels]) - outshape = tf.pack([derived_size, LABEL_SIZE]) + concated = tf.concat(axis=1, values=[indices, sparse_labels]) + outshape = tf.stack([derived_size, LABEL_SIZE]) new_batch_labels = tf.sparse_to_dense(concated, outshape, 1.0, 0.0) _, train_auc = tf.contrib.metrics.streaming_auc(train_softmax, new_batch_labels) @@ -343,8 +343,8 @@ def inference(inputs, is_train=True): sparse_labels = tf.reshape(validate_batch_labels, [-1, 1]) derived_size = tf.shape(validate_batch_labels)[0] indices = tf.reshape(tf.range(0, derived_size, 1), [-1, 1]) - concated = tf.concat(concat_dim=1, values=[indices, sparse_labels]) - outshape = tf.pack([derived_size, LABEL_SIZE]) + concated = tf.concat(axis=1, values=[indices, sparse_labels]) + outshape = tf.stack([derived_size, LABEL_SIZE]) new_validate_batch_labels = tf.sparse_to_dense(concated, outshape, 1.0, 0.0) _, validate_auc = tf.contrib.metrics.streaming_auc(validate_softmax, new_validate_batch_labels) diff --git a/sparse_classifier.py b/sparse_classifier.py index 8415c32..5ba1eff 100755 --- a/sparse_classifier.py +++ b/sparse_classifier.py @@ -281,8 +281,8 @@ def inference(sparse_ids, sparse_values, is_train=True): sparse_labels = tf.reshape(batch_labels, [-1, 1]) derived_size = tf.shape(batch_labels)[0] indices = tf.reshape(tf.range(0, derived_size, 1), [-1, 1]) - concated = tf.concat(concat_dim=1, values=[indices, sparse_labels]) - outshape = tf.pack([derived_size, LABEL_SIZE]) + concated = tf.concat(axis=1, values=[indices, sparse_labels]) + outshape = tf.stack([derived_size, LABEL_SIZE]) new_train_batch_labels = tf.sparse_to_dense(concated, outshape, 1.0, 0.0) _, train_auc = tf.contrib.metrics.streaming_auc(train_softmax, new_train_batch_labels) @@ -302,8 +302,8 @@ def inference(sparse_ids, sparse_values, is_train=True): sparse_labels = tf.reshape(validate_batch_labels, [-1, 1]) derived_size = tf.shape(validate_batch_labels)[0] indices = tf.reshape(tf.range(0, derived_size, 1), [-1, 1]) - concated = tf.concat(concat_dim=1, values=[indices, sparse_labels]) - outshape = tf.pack([derived_size, LABEL_SIZE]) + concated = tf.concat(axis=1, values=[indices, sparse_labels]) + outshape = tf.stack([derived_size, LABEL_SIZE]) new_validate_batch_labels = tf.sparse_to_dense(concated, outshape, 1.0, 0.0) _, validate_auc = tf.contrib.metrics.streaming_auc(validate_softmax, new_validate_batch_labels)