carpedm20/lstm-char-cnn-tensorflow

Program break due to tensorflow version

sushanwang opened this issue · 2 comments

Hi,
I'm using Python2.7 and tensorflow1.0.0 to run this project.
The project first got "TypeError: slice indices must be integers or None" in:
"batch_loader.py", line 49, in init
data = data[: batch_size * seq_length * math.floor(length / (batch_size * seq_length))]
I fixed this by change it to:
data = data[: int(batch_size * seq_length * math.floor(length / (batch_size * seq_length)))]
Then the project got ValueError in
"LSTMTDNN.py", line 126, in prepare_model
char_index = tf.reshape(char_indices[idx], [-1, self.max_word_length])
ValueError: Dimension size must be evenly divisible by 21 but is 1 for 'LSTMTDNN/CNN/Reshape' (op: 'Reshape') with input shapes: [], [2].

The number 21 for ptb dataset and 65 for nsmc dataset.

What should I do? Thanks!

It seems that's the issue with tensorflow version, thensorflow1.0.0 changes lots of API in old version, so the program is unable to process.
i'm trying to fix function with new features...

Why was this issue closed? It is still not fixed.