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

Shape must be of rank 4 but is of rank 3 #34

Closed pradiepsingh closed 6 years ago

pradiepsingh commented 6 years ago

Hi,

While running train.py I am getting below error:

Shape must be rank 4 but is rank 3 for 'conv-maxpool-3/concat_2' (op: 'ConcatV2') with input shapes: [?,1,300,1], [?,548,1], [?,1,300,1], [].

This is happening in text_cnn_rnn.py at conv = tf.nn.conv2d(emb_pad, W, strides=[1, 1, 1, 1], padding='VALID', name='conv')

Can any one support in providing some help on this.

jiegzhan commented 6 years ago

I just ran the train.py, it worked for me.

python3 train.py ./data/train.csv.zip ./training_config.json

This is tensorflow on my machine: tensorflow-gpu (1.3.0)

pradiepsingh commented 6 years ago

Thanks fir your reply, Just want to tell you I am running it on python 3 tensorflow 1 on Windows is it the problem? Also not able to call sys.argv[1] it is showing list index out of range for calling the upload path of data_helper.py

pradiepsingh commented 6 years ago

Hi Jie, One more thing I would like to know do I need these modules to run on Apache? If you can post some solution for Windows..

pradiepsingh commented 6 years ago

Hi Jie, Thanks it is working.