瀏覽代碼

Updated concat_v2 to concat for 1.0 compatibility

Updated concat_v2 to concat for version 1.0 compatibility for breaking changes introduced in version 1.0
"tf.concat now takes arguments in reversed order and with different keywords. In particular we now match NumPy order as tf.concat(values, axis, name)"
Parth Shah 8 年之前
父節點
當前提交
dad7dcbda1
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      im2txt/im2txt/show_and_tell_model.py

+ 2 - 2
im2txt/im2txt/show_and_tell_model.py

@@ -264,7 +264,7 @@ class ShowAndTellModel(object):
       if self.mode == "inference":
       if self.mode == "inference":
         # In inference mode, use concatenated states for convenient feeding and
         # In inference mode, use concatenated states for convenient feeding and
         # fetching.
         # fetching.
-        tf.concat_v2(initial_state, 1, name="initial_state")
+        tf.concat(initial_state, 1, name="initial_state")
 
 
         # Placeholder for feeding a batch of concatenated states.
         # Placeholder for feeding a batch of concatenated states.
         state_feed = tf.placeholder(dtype=tf.float32,
         state_feed = tf.placeholder(dtype=tf.float32,
@@ -278,7 +278,7 @@ class ShowAndTellModel(object):
             state=state_tuple)
             state=state_tuple)
 
 
         # Concatentate the resulting state.
         # Concatentate the resulting state.
-        tf.concat_v2(state_tuple, 1, name="state")
+        tf.concat(state_tuple, 1, name="state")
       else:
       else:
         # Run the batch of sequence embeddings through the LSTM.
         # Run the batch of sequence embeddings through the LSTM.
         sequence_length = tf.reduce_sum(self.input_mask, 1)
         sequence_length = tf.reduce_sum(self.input_mask, 1)