jiegzhan / multi-class-text-classification-cnn

Classify Kaggle Consumer Finance Complaints into 11 classes. Build the model with CNN (Convolutional Neural Network) and Word Embeddings on Tensorflow.
Apache License 2.0
426 stars 198 forks source link

error while training #3

Open mdeora opened 7 years ago

mdeora commented 7 years ago

Traceback (most recent call last): File "train.py", line 136, in train_cnn() File "train.py", line 59, in train_cnn l2_reg_lambda=params['l2_reg_lambda']) File "/webserver/github/multi-class-text-classification-cnn/text_cnn.py", line 49, in init self.h_pool = tf.concat(3, pooled_outputs) File "/usr/local/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1047, in concat dtype=dtypes.int32).get_shape( File "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 651, in convert_to_tensor as_ref=False) File "/usr/local/lib/python3.6/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 "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 176, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name) File "/usr/local/lib/python3.6/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 "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/tensor_util.py", line 367, in make_tensor_proto _AssertCompatible(values, dtype) File "/usr/local/lib/python3.6/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.

jiegzhan commented 7 years ago

Which version of tensorflow?

I was using tensorflow 0.9 to train the model.

mdeora commented 7 years ago

I am on 1.0.1

mookrs commented 7 years ago

See https://github.com/dennybritz/cnn-text-classification-tf/issues/67

mdeora commented 7 years ago

Thanks it works now, but another error during predict

Traceback (most recent call last): File "predict.py", line 73, in predict_unseen_data() File "predict.py", line 19, in predict_unseen_data checkpoint_file = tf.train.latest_checkpoint(checkpoint_dir + 'checkpoints') File "/usr/local/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1493, in latest_checkpoint if file_io.get_matching_files(v2_path) or file_io.get_matching_files( File "/usr/local/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 269, in get_matching_files compat.as_bytes(filename), status)] File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/contextlib.py", line 89, in exit next(self.gen) File "/usr/local/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 469, in raise_exception_on_not_ok_status pywrap_tensorflow.TF_GetCode(status)) tensorflow.python.framework.errors_impl.NotFoundError: /home/ubuntu/multi-class-text-classification-cnn/trained_model_1479757124/checkpoints

jiegzhan commented 7 years ago

https://github.com/jiegzhan/multi-class-text-classification-cnn-rnn/issues/2

Please look at the issue above.