practical_seq2seq icon indicating copy to clipboard operation
practical_seq2seq copied to clipboard

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

Open karanpande opened this issue 6 years ago • 11 comments

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 avatar Sep 28 '17 19:09 karanpande

Thank you

karanpande avatar Oct 04 '17 19:10 karanpande

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)

bandarikanth avatar Dec 20 '17 11:12 bandarikanth

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

zwep avatar Jan 02 '18 13:01 zwep

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 [email protected]

On 02-Jan-2018 6:51 PM, "zwep" [email protected] 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 .

bandarikanth avatar Jan 02 '18 13:01 bandarikanth

.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 <[email protected]mailto:[email protected]> 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.

karanpande avatar Jan 02 '18 13:01 karanpande

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

pzhao16me avatar Mar 01 '18 03:03 pzhao16me

@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 avatar Mar 11 '18 04:03 ombits

It worked after changing the tf version to 1.0.0

ombits avatar Mar 13 '18 19:03 ombits

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 <[email protected]mailto:[email protected]> 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.

karanpande avatar Mar 14 '18 02:03 karanpande

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

pzhao16me avatar Mar 14 '18 03:03 pzhao16me

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

pzhao16me avatar Mar 14 '18 03:03 pzhao16me