Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update TF version to 1.9 #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion run_multi-task_rnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def create_model(session,

def train():
print ('Applying Parameters:')
for k,v in FLAGS.__dict__['__flags'].iteritems():
for k,v in FLAGS.__flags.iteritems():
print ('%s: %s' % (k, str(v)))
print("Preparing data in %s" % FLAGS.data_dir)
vocab_path = ''
Expand Down
10 changes: 7 additions & 3 deletions seq_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@
from six.moves import xrange # pylint: disable=redefined-builtin
# We disable pylint because we need python3 compatibility.
import tensorflow as tf
from tensorflow.python.ops import rnn_cell_impl

linear = rnn_cell_impl._linear
try:
from tensorflow.python.ops import rnn_cell_impl
linear = rnn_cell_impl._linear
except AttributeError:
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import _linear
linear = _linear

def attention_single_output_decoder(initial_state,
attention_states,
Expand Down Expand Up @@ -131,4 +135,4 @@ def generate_single_output(encoder_state, attention_states, sequence_length,
batch_size = tf.shape(targets[0])[0]
loss = tf.reduce_sum(crossent) / tf.cast(batch_size, tf.float32)

return bucket_outputs, loss
return bucket_outputs, loss
9 changes: 6 additions & 3 deletions seq_labeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
from tensorflow.contrib.legacy_seq2seq import sequence_loss_by_example
from tensorflow.contrib.legacy_seq2seq import sequence_loss

from tensorflow.python.ops import rnn_cell_impl

linear = rnn_cell_impl._linear
try:
from tensorflow.python.ops import rnn_cell_impl
linear = rnn_cell_impl._linear
except AttributeError:
from tensorflow.contrib.rnn.python.ops.core_rnn_cell import _linear
linear = _linear

def _step(time, sequence_length, min_sequence_length,
max_sequence_length, zero_logit, generate_logit):
Expand Down