From 648ce9775f3f46e024e338b6d2d23158da8e76c6 Mon Sep 17 00:00:00 2001 From: zsdonghao Date: Fri, 8 Sep 2017 11:22:18 +0100 Subject: [PATCH] Undefined names can raise NameError at runtime --> https://github.com/zsdonghao/seq2seq-chatbot/issues/1 --- tensorlayer/layers.py | 4 ++-- tensorlayer/prepro.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tensorlayer/layers.py b/tensorlayer/layers.py index ba579810e..fc895181b 100755 --- a/tensorlayer/layers.py +++ b/tensorlayer/layers.py @@ -5973,9 +5973,9 @@ def sampled_loss(inputs, labels): cell = cell_creator() if num_layers > 1: try: # TF1.0 - cell = tf.contrib.rnn.MultiRNNCell([single_cell] * num_layers) + cell = tf.contrib.rnn.MultiRNNCell([cell] * num_layers) except: - cell = tf.nn.rnn_cell.MultiRNNCell([single_cell] * num_layers) + cell = tf.nn.rnn_cell.MultiRNNCell([cell] * num_layers) # ============== Seq Decode Layer ============ # The seq2seq function: we use embedding for the input and attention. diff --git a/tensorlayer/prepro.py b/tensorlayer/prepro.py index e99808706..65bab713b 100644 --- a/tensorlayer/prepro.py +++ b/tensorlayer/prepro.py @@ -994,7 +994,7 @@ def channel_shift(x, intensity, is_random=False, channel_index=2): # x = np.rollaxis(x, 0, channel_index+1) # return x -def channel_shift_multi(x, intensity, channel_index=2): +def channel_shift_multi(x, intensity, is_random=False, channel_index=2): """Shift the channels of images with the same arguments, randomly or non-randomly, see `numpy.rollaxis `_ . Usually be used for image segmentation which x=[X, Y], X and Y should be matched.