cnn-text-classification-tf
cnn-text-classification-tf copied to clipboard
Expected int32 but got a list containing Tensors of type '_Message' in "train.py"
Hi,
Thanks for the excellent piece of work . But I'm getting the following error while I try to initiate the function call in this line . Not sure whats wrong .
Message : Expected int32 but got a list containing Tensors of type '_Message' in "train.py"
cnn = TextCNN(
sequence_length=x_train.shape[1],
num_classes=y_train.shape[1],
vocab_size=len(vocab_processor.vocabulary_),
embedding_size=FLAGS.embedding_dim,
filter_sizes=list(map(int, FLAGS.filter_sizes.split(","))),
num_filters=FLAGS.num_filters,
l2_reg_lambda=FLAGS.l2_reg_lambda
)
Using the fix suggested here https://github.com/dennybritz/cnn-text-classification-tf/issues/67 works. They changed some API calls in TF 1.0
When I run this program with cpu version of tensorflow, it works well. But it throws an exception when training with the gpu version of tensorflow. The error message is as following. How can I to solve this problem?
TypeError: Expected int32, got list containing Tensors of type '_Message' instead.
Traceback (most recent call last):
File "train.py", line 111, in
See https://github.com/tensorflow/tensorflow/issues/7031 for solution
the given link https://github.com/tensorflow/tensorflow/issues/7031 is not working
@benstoffelen It's work for me!