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

issue regarding training file please help #5

Open akshataph opened 7 years ago

akshataph commented 7 years ago

W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. Traceback (most recent call last): 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/akshata/keras_NN/multi-class-text-classification-cnn-rnn-master/text_cnn_rnn.py", line 34, in init pad_prio = tf.concat(1, [self.pad] * num_prio) File "/root/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1047, in concat dtype=dtypes.int32).get_shape( File "/root/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 651, in convert_to_tensor as_ref=False) File "/root/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 716, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref) File "/root/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 176, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name) File "/root/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/constant_op.py", line 165, in constant tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape)) File "/root/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 367, in make_tensor_proto _AssertCompatible(values, dtype) File "/root/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 302, in _AssertCompatible (dtype.name, repr(mismatch), type(mismatch).name)) TypeError: Expected int32, got list containing Tensors of type '_Message' instead.

ushagayatri commented 7 years ago

Are you able to solve this error? Please let me know

Jason2031 commented 7 years ago

I met this error using tf 1.0. After some googling, I found that the args of tf.concat() function were changed in tf 1.0. This project was built using tf 0.9, where args of tf.concat() func were tf.concat(int32, tensor), the args were changed to tf.concat(tensor, int32) in tf 1.0.