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

RuntimeError: Input, output and indices must be on the current device #7

Open
vanditrogheliyahops opened this issue Sep 20, 2021 · 0 comments

Comments

@vanditrogheliyahops
Copy link

vanditrogheliyahops commented Sep 20, 2021

Hey there, can any one solve this error which I'm getting while running run.py file.
I'm using pre-trained model which is shared in read.me file.

Traceback (most recent call last):
File "D:/vandit/summarize-radiology-findings-master/run.py", line 91, in
main()
File "D:/vandit/summarize-radiology-findings-master/run.py", line 83, in main
sum_words = run(background, findings, trainer, vocab, opt)
File "D:/vandit/summarize-radiology-findings-master/run.py", line 64, in run
preds = trainer.model.predict(src, bg, opt['beam_size'])
File "D:\vandit\summarize-radiology-findings-master\model\copy_model.py", line 234, in predict
enc_inputs = self.embedding(src)
File "D:\vandit\venv\lib\site-packages\torch\nn\modules\module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "D:\vandit\venv\lib\site-packages\torch\nn\modules\sparse.py", line 124, in forward
return F.embedding(
File "D:\vandit\venv\lib\site-packages\torch\nn\functional.py", line 1852, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Input, output and indices must be on the current device

@vanditrogheliyahops vanditrogheliyahops changed the title RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking arugment for argument index in method wrapper_index_select) RuntimeError: Input, output and indices must be on the current device Sep 22, 2021
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