Skip to content

Commit

Permalink
Undefined names can raise NameError at runtime --> tensorlayer/seq2se…
Browse files Browse the repository at this point in the history
  • Loading branch information
zsdonghao committed Sep 8, 2017
1 parent ae3a6fc commit 648ce97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tensorlayer/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tensorlayer/prepro.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://docs.scipy.org/doc/numpy/reference/generated/numpy.rollaxis.html>`_ .
Usually be used for image segmentation which x=[X, Y], X and Y should be matched.
Expand Down

0 comments on commit 648ce97

Please sign in to comment.