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

IndexError: index out of bounds #9

Open
muety opened this issue Oct 12, 2017 · 5 comments
Open

IndexError: index out of bounds #9

muety opened this issue Oct 12, 2017 · 5 comments

Comments

@muety
Copy link

muety commented Oct 12, 2017

I'm getting the following error. Does anybody else have this problem?
Python 3.6 on Windows.

 File "main.py", line 61, in <module>
    tf.app.run()
  File "C:\Users\Ferdinand\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "main.py", line 58, in main
    model.run(train_data, test_data)
  File "D:\dev\mem_absa\model.py", line 264, in run
    train_loss, train_acc = self.train(train_data)
  File "D:\dev\mem_absa\model.py", line 175, in train
    m = rand_idx[cur]
IndexError: index 2358 is out of bounds for axis 0 with size 2358
@wodeweilai
Copy link

Do you deal with this problem?

@wodeweilai
Copy link

I also meet this problem.

@morning-ding
Copy link

have you solved it yet? i have the same question.

@pcgreat
Copy link

pcgreat commented Oct 30, 2017

that's bug easy to fix. rand_idx should be the list of shuffled train/test data, and since N is choosing the ceil, something that will cause cur to be larger than the length of rand_idx, my fix is to add a break if cur is larger than the length of rand_idx. You can check my fork to see the fix

@amanchuan
Copy link

the incorrect process in preprocessing may also cause this problem. you can check your source_data, target_data and target label.

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

5 participants