LeeSureman / Flat-Lattice-Transformer

code for ACL 2020 paper: FLAT: Chinese NER Using Flat-Lattice Transformer
1k stars 178 forks source link

在自己的数据上出现错误 #124

Open nlper01 opened 1 year ago

nlper01 commented 1 year ago
C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\IndexKernel.cu:91: block: [98287,0,0], thread: [92,0,0] Assertion `index >= -sizes[i] && index < sizes[i] && "index out of bounds"` failed.
C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\IndexKernel.cu:91: block: [98287,0,0], thread: [93,0,0] Assertion `index >= -sizes[i] && index < sizes[i] && "index out of bounds"` failed.
C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\IndexKernel.cu:91: block: [98287,0,0], thread: [94,0,0] Assertion `index >= -sizes[i] && index < sizes[i] && "index out of bounds"` failed.
C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\IndexKernel.cu:91: block: [98287,0,0], thread: [95,0,0] Assertion `index >= -sizes[i] && index < sizes[i] && "index out of bounds"` failed.
Traceback (most recent call last):
  File "F:\#CNER\Flat-Lattice-Transformer\V0\flat_main.py", line 637, in <module>
    trainer.train()
  File "D:\Anaconda3\envs\CNER_1.0\lib\site-packages\fastNLP\core\trainer.py", line 616, in train
    raise e
  File "D:\Anaconda3\envs\CNER_1.0\lib\site-packages\fastNLP\core\trainer.py", line 609, in train
    self._train()
  File "D:\Anaconda3\envs\CNER_1.0\lib\site-packages\fastNLP\core\trainer.py", line 664, in _train
    prediction = self._data_forward(self.model, batch_x)
  File "D:\Anaconda3\envs\CNER_1.0\lib\site-packages\fastNLP\core\trainer.py", line 752, in _data_forward
    y = network(**x)
  File "D:\Anaconda3\envs\CNER_1.0\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "F:\#CNER\Flat-Lattice-Transformer\V0\models.py", line 488, in forward
    encoded = self.encoder(embedding,seq_len,lex_num=lex_num,pos_s=pos_s,pos_e=pos_e,
  File "D:\Anaconda3\envs\CNER_1.0\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "F:\#CNER\Flat-Lattice-Transformer\V0\modules.py", line 1333, in forward
    rel_pos_embedding = self.four_pos_fusion_embedding(pos_s,pos_e)
  File "D:\Anaconda3\envs\CNER_1.0\lib\site-packages\torch\nn\modules\module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "F:\#CNER\Flat-Lattice-Transformer\V0\modules.py", line 93, in forward
    pe_ss = self.pe_ss[(pos_ss).view(-1)+self.max_seq_len].view(size=[batch,max_seq_len,max_seq_len,-1])
RuntimeError: CUDA error: device-side assert triggered

这是什么问题啊?数据处理应该没问题