Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Index out of range error during eval #5

Open
codeaway23 opened this issue Apr 4, 2020 · 0 comments
Open

Index out of range error during eval #5

codeaway23 opened this issue Apr 4, 2020 · 0 comments

Comments

@codeaway23
Copy link

for i in range(decoder_output.size(1)):
    loss += criterion(decoder_output[:, i, :].squeeze(), target_tensor[:, i + 1])

line 55 in train_utils throws the following error -

IndexError: index 7 is out of bounds for dimension 1 with size 7

if i change the i+1 in the above mentioned line to i, the script runs fine but my evaluation accuracy doesn't change at all even though after 100 epochs training accuracy reaches 85%.

To make this hack work, i also have to change i+1 to i in line 64.

Similar lines are there in train_batch function too but that doesn't throw an error. Only eval does.

Could you tell me what these particular lines do and how I can fix this issue?

Thanks in advance.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant