white127 / QA-deep-learning

tensorflow and theano cnn code for insurance QA(question Answer matching)
531 stars 283 forks source link

TypeError: Expected int32, got list containing Tensors of type '_Message' instead. #19

Open liuluyeah opened 6 years ago

liuluyeah commented 6 years ago

请问这个怎么解决,谢谢!

liuluyeah commented 6 years ago

完整错误如下,我用的win10 anaconda3: input_x_1 Tensor("input_x_1:0", shape=(100, 200), dtype=int32, device=/device:CPU:0) Traceback (most recent call last):

File "", line 1, in runfile('E:/bs/QA/insuranceQA-cnn-lstm-master/cnn/tensorflow/insqa_train.py', wdir='E:/bs/QA/insuranceQA-cnn-lstm-master/cnn/tensorflow')

File "D:\Anaconda2\envs\py3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile execfile(filename, namespace)

File "D:\Anaconda2\envs\py3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "E:/bs/QA/insuranceQA-cnn-lstm-master/cnn/tensorflow/insqa_train.py", line 76, in l2_reg_lambda=FLAGS.l2_reg_lambda)

File "E:\bs\QA\insuranceQA-cnn-lstm-master\cnn\tensorflow\insqa_cnn.py", line 100, in init pooled_reshape_1 = tf.reshape(tf.concat(3, pooled_outputs_1), [-1, num_filters_total])

File "D:\Anaconda2\envs\py3\lib\site-packages\tensorflow\python\ops\array_ops.py", line 1061, in concat dtype=dtypes.int32).get_shape(

File "D:\Anaconda2\envs\py3\lib\site-packages\tensorflow\python\framework\ops.py", line 611, in convert_to_tensor as_ref=False)

File "D:\Anaconda2\envs\py3\lib\site-packages\tensorflow\python\framework\ops.py", line 676, in internal_convert_to_tensor ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)

File "D:\Anaconda2\envs\py3\lib\site-packages\tensorflow\python\framework\constant_op.py", line 121, in _constant_tensor_conversion_function return constant(v, dtype=dtype, name=name)

File "D:\Anaconda2\envs\py3\lib\site-packages\tensorflow\python\framework\constant_op.py", line 102, in constant tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape, verify_shape=verify_shape))

File "D:\Anaconda2\envs\py3\lib\site-packages\tensorflow\python\framework\tensor_util.py", line 376, in make_tensor_proto _AssertCompatible(values, dtype)

File "D:\Anaconda2\envs\py3\lib\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.

HunterXuan commented 6 years ago

如果你是 python 3.6 的话,可以参考我的 commit 试试