New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexError: index 1 is out of bounds for axis 0 with size 1 #15
Comments
Try to replace the line By the way, I finished the training, but did not get the same, reasonable quality of predicted text as zackthoutt demonstrated. |
@tonyatml, @YangWangGit are you using Tensorflow 1.0.0? @YangWangGit, the output of the network should not have a depth of three. That is likely why you are not getting good results. Also keep in mind that training networks like this is tricky and involves a lot of tinkering. When I trained the network I ran several instances at once with different combinations of hyperparameters. I also downloaded all of the networks every half hour or so while they were training and tested how well they generated text. I think that the model I actually ended up generating the text with used slightly different hyperparameters than what I have posted in this repo. I think my best one had a larger word embedding layer and a longer sequence length. Also note that I did not train the full number of epochs defined in the code. I stopped all of the models training well before reaching the max value. Training too much will either force your weights into a local minima or overfit, both of which lead to worse results. |
@zackthoutt ,I am using version 1.3.0 installed via 'pip install' with GPU support. The python version is 2.7.12. |
You need to use Tensorflow 1.0.0. There are updates that will break the code in 1.3.0. |
Traceback (most recent call last): |
IndexError Traceback (most recent call last)
in ()
29 {input_text: dyn_input, initial_state: prev_state})
30
---> 31 pred_word = pick_word(probabilities[dyn_seq_length-1], int_to_vocab)
32
33 gen_sentences.append(pred_word)
IndexError: index 1 is out of bounds for axis 0 with size 1
The text was updated successfully, but these errors were encountered: