jiegzhan/multi-class-text-classification-cnn-rnn

don't work with python2.7 and tensorflow0.9

mjqgit opened this issue · 1 comments

Traceback (most recent call last):
File "/home/mjq/PycharmProjects/multi-class-text/multi-class-text-classification-cnn-rnn/train.py", line 167, in
train_cnn_rnn()
File "/home/mjq/PycharmProjects/multi-class-text/multi-class-text-classification-cnn-rnn/train.py", line 63, in train_cnn_rnn
l2_reg_lambda=params['l2_reg_lambda'])
File "/home/mjq/PycharmProjects/multi-class-text/multi-class-text-classification-cnn-rnn/text_cnn_rnn.py", line 56, in init
lstm_cell = tf.contrib.rnn.DropoutWrapper(lstm_cell, output_keep_prob=self.dropout_keep_prob)
AttributeError: 'module' object has no attribute 'DropoutWrapper'

Instead of this:
lstm_cell = tf.contrib.rnn.DropoutWrapper(lstm_cell, output_keep_prob=self.dropout_keep_prob)

Use this:
lstm_cell = tf.nn.rnn_cell.DropoutWrapper(lstm_cell, output_keep_prob=self.dropout_keep_prob)