suriyadeepan / practical_seq2seq

A simple, minimal wrapper for tensorflow's seq2seq module, for experimenting with datasets rapidly
http://suriyadeepan.github.io/2016-12-31-practical-seq2seq/
GNU General Public License v3.0
569 stars 270 forks source link

basic_cell = tf.contrib.rnn.core_rnn_cell.DropoutWrapper( AttributeError: module 'tensorflow.contrib.rnn' has no attribute 'core_rnn_cell' #47

Open karanpande opened 7 years ago

karanpande commented 7 years ago

I am on python 3 and tensorflow version 0.12.0

i am getting this error while calling 03-twitter-chatbot.py can someone help me solve this

karanpande commented 7 years ago

Thank you

bandarikanth commented 6 years ago

replace this code in place of previous code: use tensorflow>=1.0

basic_cell = tf.contrib.rnn.DropoutWrapper( tf.contrib.rnn.BasicLSTMCell(emb_dim, state_is_tuple=True), output_keep_prob=self.keep_prob)

stack cells together : n layered model

        stacked_lstm = tf.contrib.rnn.MultiRNNCell([basic_cell] * num_layers, state_is_tuple=True)
zwep commented 6 years ago

Shouldnt it be something like tf.nn.rnn_cell.... ?

bandarikanth commented 6 years ago

It's tf.contrib.rnn.your requirements. Like to.contrib.rnn.basiclstm or dropout. You need to use tensorflow =1.2 or above

If you have further questions mail me at bandarikanth810@gmail.com

On 02-Jan-2018 6:51 PM, "zwep" notifications@github.com wrote:

Shouldnt it be something like tf.nn.rnn_cell.... ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/suriyadeepan/practical_seq2seq/issues/47#issuecomment-354765193, or mute the thread https://github.com/notifications/unsubscribe-auth/AZf77cMLrZsD7aII5k0IqHM2XWplw9W-ks5tGi1zgaJpZM4Pnvx2 .

karanpande commented 6 years ago

.nn or contrib depends on the tensorflow version . E.g.if on tensorflow 1.0 and above use contrib, if using the 0.9 and below use nn.

Sent from my iPhone

On Jan 2, 2018, at 6:52 PM, zwep notifications@github.com<mailto:notifications@github.com> wrote:

Shouldnt it be something like tf.nn.rnn_cell.... ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/suriyadeepan/practical_seq2seq/issues/47#issuecomment-354765193, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AKaB9K8N5_vBFq47grXDfKx7GEUMUZjwks5tGi1zgaJpZM4Pnvx2.

pzhao16me commented 6 years ago

it the tf.VERSION > 1.0 , Then use 'tf.contrib.rnn.DropoutWrapper()' to replace 'tf.contrib.rnn.core_rnn_cell.DropoutWrapper()' the same way for the 'tf.contrib.rnn.BasicLSTMCell ()' and the 'tf.contrib.rnn.MultiRNNCell()'

this will be ok

ombits commented 6 years ago

@zp672087110 : i am using python 3.6.4 and tf version 1.2.1. i modified as you suggested above and getting following error message basic_cell = tf.contrib.rnn.DropoutWrapper(tf.contrib.rnn.BasicLSTMCell(emb_dim, state_is_tuple=True),output_keep_prob=self.keep_prob) AttributeError: module 'tensorflow.contrib.rnn' has no attribute 'DropoutWrapper'

ombits commented 6 years ago

It worked after changing the tf version to 1.0.0

karanpande commented 6 years ago

It should technically work for anything above tf version 1.0.0 . But I'm glad it's working for you .

Sent from my iPhone

On Mar 13, 2018, at 3:54 PM, ombits notifications@github.com<mailto:notifications@github.com> wrote:

It worked after changing the tf version to 1.0.0

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/suriyadeepan/practical_seq2seq/issues/47#issuecomment-372797000, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AKaB9JkmTIeYRypBeMyzTZ2gsgZHKJfgks5teCPbgaJpZM4Pnvx2.

pzhao16me commented 6 years ago

@ombits sorry i just see now, the version i use is 1.2.

pzhao16me commented 6 years ago

@karanpande maybe you need to check the seq2seq_wrapper.py or update it