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
List index out of range #408
Comments
This code is working perfectly fine for me. Can you try to re-install tflearn? |
I'm getting a similar error. Here's a link to the SO question I asked. http://stackoverflow.com/questions/40200311/tflearn-covnet-example-resulting-in-an-error-w-cifar-10 Are you using python notebooks? |
same error here, while running quickstart tutorial on ipython notebook Edit: restarting kernel solved the problem |
Yeah. I've found when I run the session for the first time it works correctly but I get the index error when I tried to rerun the notebook cell. @cemysf I noticed that in ipython notebooks when using vanilla tensor flow that variables get namespaced to the number of iterations of the cell. My quick fix was to use Perhaps it's worth submitting a PR to address this issue? |
Restarting kernel solved my problem too. |
For me , adding this line before any code do the trick: |
For me restarting kernel doesn't work, adding tf.reset_default_graph() does. |
Restarting the kernel worked. I don't know why this is a recurring problem in Jupyter Notebooks. Some bug I suppose. |
How do you restart a kernel? Thank you |
I used:
but same error is there: |
Worked for me! from tensorflow import reset_default_graph
reset_default_graph() , then I reran the code that built the network. Then I ran the |
I still get the same exact error, even with the from tensorflow import reset_default_graph & I've restarted the kernel as well, no luck. |
Funzione per me. Grazie! from tensorflow import reset_default_graph |
For me, it was working with jupyter-notebook and to tweak a model, I need to reset tensorflow graph by tf.reset_default_graph() every time. |
I got the same error when using jupyter notebook, and restarting kernel solved the problem. |
I am trying to run tflearn for simple mnist classification using MLP. I tried to other example and I am getting this error for almost all. I just started using TFlearn.
IndexError Traceback (most recent call last)
in ()
48 max_checkpoints=10, tensorboard_verbose=0)
49 model.fit(X, Y, n_epoch=100, validation_set=(testX, testY),
---> 50 show_metric=True, batch_size=256, run_id='resnet_mnist')
/usr/local/lib/python2.7/dist-packages/tflearn/models/dnn.pyc in fit(self, X_inputs, Y_targets, n_epoch, validation_set, show_metric, batch_size, shuffle, snapshot_epoch, snapshot_step, excl_trainops, run_id)
155 # TODO: check memory impact for large data and multiple optimizers
156 feed_dict = feed_dict_builder(X_inputs, Y_targets, self.inputs,
--> 157 self.targets)
158 feed_dicts = [feed_dict for i in self.train_ops]
159 val_feed_dicts = None
/usr/local/lib/python2.7/dist-packages/tflearn/utils.pyc in feed_dict_builder(X, Y, net_inputs, net_targets)
265 X = [X]
266 for i, x in enumerate(X):
--> 267 feed_dict[net_inputs[i]] = x
268 else:
269 # If a dict is provided
IndexError: list index out of range
Code
The text was updated successfully, but these errors were encountered: