allenai / allennlp

An open-source NLP research library, built on PyTorch.
http://www.allennlp.org
Apache License 2.0
11.74k stars 2.24k forks source link

.numpy() command in _aggregate_token_embeddings isn't detaching from GPU into CPU label:bug #5652

Closed lizardintelligence closed 2 years ago

lizardintelligence commented 2 years ago

I believe embeddings.numpy() on line 45 and 63 of saliency_interpreter.py should be embeddings.detach().cpu().numpy() Otherwise while running the interpretation on GPU has a error 'TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.'

github-actions[bot] commented 2 years ago

This issue is being closed due to lack of activity. If you think it still needs to be addressed, please comment on this thread 👇