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

Error in validation and testing #28

Open
omidvaramin opened this issue Mar 28, 2021 · 1 comment
Open

Error in validation and testing #28

omidvaramin opened this issue Mar 28, 2021 · 1 comment

Comments

@omidvaramin
Copy link

Hi, when I want to run either validation or testing phase, there is an error in the advance function of beamsearch as below:

self.hid_h = h[beams_order] #(beam, n_hid); sorted
IndexError: tensors used as indices must be long, byte or bool tensors

the output for beams_order is tensor([0.0557, 0.0172, 0.0002, 0.0270], device='cuda:0')

@omidvaramin
Copy link
Author

I changed / to // in the following line of code of beam_search.py, and the problem is solved,
beams_order = best_scores_id.squeeze(1)//n_extended_vocab

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

1 participant