简体   繁体   中英

Tensorflow rnn: name 'seq2seq' is not defined

I am trying this notebook: https://github.com/sjchoi86/Tensorflow-101/blob/master/notebooks/char_rnn_sample_tutorial.ipynb

I have a problem with this line In[6]:

outputs, final_state = seq2seq.rnn_decoder(inputs, istate, cell, loop_function=None, scope='rnnlm')

I get this error:

NameError: name 'seq2seq' is not defined

I am using tensorflow 1.0.1. I tried

tf.contrib.seq2seq

but I am getting error:

AttributeError: 'module' object has no attribute 'rnn_decoder'

I think it is a probleme with the new implementation of rnn network in tensorflow 1.0.1 but I don't know how to fix it.

Because seq2seq has been moved to tf.contrib.legacy_seq2seq . You should change this line to:

outputs, final_state = tf.contrib.legacy_seq2seq.rnn_decoder(inputs, istate, cell, loop_function=None, scope='rnnlm')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM