Skip to content
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

python2.7 IndexError: list index out of range #14

Closed
zhaoyingjun opened this issue Apr 10, 2017 · 8 comments
Closed

python2.7 IndexError: list index out of range #14

zhaoyingjun opened this issue Apr 10, 2017 · 8 comments

Comments

@zhaoyingjun
Copy link

Traceback (most recent call last):
File "demo.py", line 4, in
model = Model()
File "/Users/zhaoyingjun/Downloads/generating-reviews-discovering-sentiment-master/encoder.py", line 143, in init
cells, states, logits = model(X, S, M, reuse=False)
File "/Users/zhaoyingjun/Downloads/generating-reviews-discovering-sentiment-master/encoder.py", line 93, in model
inputs = [tf.squeeze(v, [1]) for v in tf.split(1, nsteps, words)]
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/ops/array_ops.py", line 1203, in split
num = size_splits_shape.dims[0]
IndexError: list index out of range
who can tell me why please?

@dthiagarajan
Copy link

Their code is intended to be run on Python 3.4 or higher I think. If you want to run it on 2.6/7, you have to change some stuff - see #3

@zhaoyingjun
Copy link
Author

python3.5 tensorflow-1.0.1

File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/tensorflow/python/ops/array_ops.py", line 1203, in split
num = size_splits_shape.dims[0]
IndexError: list index out of range

@codypilot
Copy link

@mkdynamic
Copy link

Suggestion by @codypilot works for me (using Python 3.6.1):

git remote add g3n1uss https://github.com/g3n1uss/generating-reviews-discovering-sentiment.git
git checkout g3n1uss/compatibleWithTF101

@shenfanyi
Copy link

I have the same error.
@codypilot your code does not work for me. I have tried your code with environment including python 3.5.2 & tensorflow 1.0.1 and python 2.7.13 & tensorflow 1.0.1 ,but I got the same error: 'IndexError: list index out of range'.
Could you tell me your environment please?

@codypilot
Copy link

codypilot commented Apr 22, 2017

@shenfanyi I've had success with Python 2.7, 3.4.3 and 3.6.1 + TensorFlow 1.0.1.

@choukelly
Copy link

@codypilot How did you have success with Python 2.7 and 3.6.1?
Didn't you need to use Python 3.5 when you downloaded TensorFlow?

@Newmu
Copy link
Contributor

Newmu commented Jul 13, 2017

This project only supports python 3 and TF 1.0+ as of 83d940d

@Newmu Newmu closed this as completed Jul 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants