Coder Social home page Coder Social logo

Comments (6)

DianboWork avatar DianboWork commented on June 28, 2024

建议把错误报全

from spn4re.

ysgncss avatar ysgncss commented on June 28, 2024

=== Epoch 0 train ===
Traceback (most recent call last):
File "C:/Users/kdecm/Desktop/临时文件/SPN4RE-main/main.py", line 100, in
trainer.train_model()
File "C:\Users\kdecm\Desktop\临时文件\SPN4RE-main\trainer\trainer.py", line 77, in train_model
loss, _ = self.model(input_ids, attention_mask, targets)
File "D:\anaconda3\envs\python37\lib\site-packages\torch\nn\modules\module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "C:\Users\kdecm\Desktop\临时文件\SPN4RE-main\models\setpred4RE.py", line 22, in forward
last_hidden_state, pooler_output = self.encoder(input_ids, attention_mask)
File "D:\anaconda3\envs\python37\lib\site-packages\torch\nn\modules\module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "C:\Users\kdecm\Desktop\临时文件\SPN4RE-main\models\seq_encoder.py", line 17, in forward
last_hidden_state, pooler_output = self.bert(input_ids, attention_mask=attention_mask)
File "D:\anaconda3\envs\python37\lib\site-packages\torch\nn\modules\module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "D:\anaconda3\envs\python37\lib\site-packages\transformers\modeling_bert.py", line 783, in forward
input_ids=input_ids, position_ids=position_ids, token_type_ids=token_type_ids, inputs_embeds=inputs_embeds
File "D:\anaconda3\envs\python37\lib\site-packages\torch\nn\modules\module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "D:\anaconda3\envs\python37\lib\site-packages\transformers\modeling_bert.py", line 174, in forward
position_embeddings = self.position_embeddings(position_ids)
File "D:\anaconda3\envs\python37\lib\site-packages\torch\nn\modules\module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "D:\anaconda3\envs\python37\lib\site-packages\torch\nn\modules\sparse.py", line 114, in forward
self.norm_type, self.scale_grad_by_freq, self.sparse)
File "D:\anaconda3\envs\python37\lib\site-packages\torch\nn\functional.py", line 1724, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
IndexError: index out of range in self

from spn4re.

DianboWork avatar DianboWork commented on June 28, 2024

torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse) 这里出错了,检查一下input_ids

from spn4re.

ysgncss avatar ysgncss commented on June 28, 2024

貌似没啥问题呢

from spn4re.

ysgncss avatar ysgncss commented on June 28, 2024

解决了。把data/generated_data目录下的文件删除了就好了 . 感谢大佬!

from spn4re.

ysgncss avatar ysgncss commented on June 28, 2024

如果我想进行在线测试,输入句子输出所有的三元组,我应该怎么做?

from spn4re.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.