multi-class-text-classification-cnn-rnn icon indicating copy to clipboard operation
multi-class-text-classification-cnn-rnn copied to clipboard

tensorflow 1 migration

Open jiberi opened this issue 7 years ago • 3 comments

Migration to tensorflow 1 I changed the concat from (1,xxx) to (xxx,1) I changed the tf.nn.rnn_ to tf.contrib.rnn

But now I have this error in File "train.py", line 161, in train_cnn_rnn() File "train.py", line 60, in train_cnn_rnn l2_reg_lambda = params['l2_reg_lambda']) File "/home/administrator/django/demo/tempo/multi-class-text-classification-cnn-rnn/text_cnn_rnn.py", line 58, in init inputs = [tf.squeeze(input_, [1]) for input_ in tf.split(1, reduced, pooled_concat)] File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/ops/array_ops.py", line 1203, in split num = size_splits_shape.dims[0] IndexError: list index out of range

Any ideas?

jiberi avatar Apr 07 '17 11:04 jiberi

Are you able to solve this error? Please reply

ushagayatri avatar Apr 12 '17 16:04 ushagayatri

  1. I did this change in line 85 of text_cnn_rnn.py losses = tf.nn.softmax_cross_entropy_with_logits(labels = self.input_y, logits = self.scores) # only named arguments accepted

  2. i also changed concat from (1,xxx) to (xxx,1)

Please help with necessary changes.

ushagayatri avatar Apr 12 '17 16:04 ushagayatri

Same problem here, looking forward to the solution... I'm new to NN, but in desperate need of NN in my project...

Jason2031 avatar Apr 22 '17 00:04 Jason2031