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 when running xlnet for individual paragraphs on linux using gpu #135

Open
gaurav-95 opened this issue Jun 3, 2022 · 0 comments
Open

Comments

@gaurav-95
Copy link

I am running bertxl summarization on a GPU Ubuntu instance in AWS ec2 and it runs fine on my windows machine using CPU. But throws an error running there. Any assistance would be helpful. I am ready to give any other extra information if this was not sufficient.

File "/home/ubuntu/neus/cron_summary_desc.py", line 282, in store_summaries
sum_df = extract_summaries(df, min_desc_length)
File "/home/ubuntu/neus/cron_summary_desc.py", line 344, in extract_summaries
mini_sum_xl = ''.join(model_xl(para, num_sentences = sent_count))
File "/home/ubuntu/neus/neusenv/lib/python3.8/site-packages/summarizer/summary_processor.py", line 234, in call
return self.run(body, ratio, min_length, max_length,
File "/home/ubuntu/neus/neusenv/lib/python3.8/site-packages/summarizer/summary_processor.py", line 202, in run
sentences, _ = self.cluster_runner(sentences, ratio, algorithm, use_first, num_sentences)
File "/home/ubuntu/neus/neusenv/lib/python3.8/site-packages/summarizer/summary_processor.py", line 108, in cluster_runner
hidden = self.model(sentences)
File "/home/ubuntu/neus/neusenv/lib/python3.8/site-packages/summarizer/transformer_embeddings/bert_embedding.py", line 173, in call
return self.create_matrix(content, hidden, reduce_option, hidden_concat)
File "/home/ubuntu/neus/neusenv/lib/python3.8/site-packages/summarizer/transformer_embeddings/bert_embedding.py", line 151, in create_matrix
return np.asarray([
File "/home/ubuntu/neus/neusenv/lib/python3.8/site-packages/summarizer/transformer_embeddings/bert_embedding.py", line 152, in
np.squeeze(self.extract_embeddings(
File "/home/ubuntu/neus/neusenv/lib/python3.8/site-packages/summarizer/transformer_embeddings/bert_embedding.py", line 108, in extract_embeddings
pooled, hidden_states = self.model(tokens_tensor)[-2:]
File "/home/ubuntu/neus/neusenv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ubuntu/neus/neusenv/lib/python3.8/site-packages/transformers/models/xlnet/modeling_xlnet.py", line 1180, in forward
word_emb_k = self.word_embedding(input_ids)
File "/home/ubuntu/neus/neusenv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ubuntu/neus/neusenv/lib/python3.8/site-packages/torch/nn/modules/sparse.py", line 158, in forward
return F.embedding(
File "/home/ubuntu/neus/neusenv/lib/python3.8/site-packages/torch/nn/functional.py", line 2183, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected tensor for argument #1 'indices' to have one of the following scalar types: Long, Int; but got torch.cuda.FloatTensor instead (while checking arguments for embedding)

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