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

Classify Kaggle San Francisco Crime Description into 39 classes. Build the model with CNN, RNN (GRU and LSTM) and Word Embeddings on Tensorflow.
https://www.kaggle.com/c/sf-crime/data
Apache License 2.0
599 stars 262 forks source link

Training using tensorflow 1.0 fails #11

Open Jason2031 opened 7 years ago

Jason2031 commented 7 years ago

I learnt that you used tf 0.9 when you built this project. My tf version is 1.0. There are something different such as the location of rnn_cell.py. I've changed the source to adjust the run_cell and tf.concat() problems. However, an IndexError: list index out of range exception were thrown when I run the code. Here is the traceback.

    Traceback (most recent call last):
      File "train.py", line 165, in <module>
        train_cnn_rnn()
      File "train.py", line 62, in train_cnn_rnn
        l2_reg_lambda=params['l2_reg_lambda'])
      File "/Users/jiechengwu/Downloads/mctccr/text_cnn_rnn.py", line 60, in __init__
        inputs = [tf.squeeze(input_, [1]) for input_ in tf.split(1, reduced, pooled_concat)]
      File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py", line 1203, in split
        num = size_splits_shape.dims[0]
    IndexError: list index out of range

The exception happens in the tf.split() function. I'm new to NN, please do reply soon.

Thanks.

jiegzhan commented 7 years ago

I was using Tensorflow 0.9 when I built this project.

gustavomr commented 7 years ago

Same here. Any fix?