fastnlp / fastNLP

fastNLP: A Modularized and Extensible NLP Framework. Currently still in incubation.
https://gitee.com/fastnlp/fastNLP
Apache License 2.0
3.05k stars 451 forks source link

coreference resolution能提供下requirement.txt吗?以及运行过程中出现torch.gather出现out of range #322

Closed hquzhuguofeng closed 3 years ago

hquzhuguofeng commented 3 years ago

Epoch 1/200: 0%| | 0/560400 [00:00<?, ?it/s, loss:{0:<6.5f}]D:\指代消歧\fastNLP\fastNLP\core\batch.py:41: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray result[n] = np.array(vlist) Traceback (most recent call last): File "D:/指代消歧/fastNLP/reproduction/coreference_resolution/train.py", line 60, in trainer.train() File "D:\指代消歧\fastNLP\fastNLP\core\trainer.py", line 622, in train raise e File "D:\指代消歧\fastNLP\fastNLP\core\trainer.py", line 615, in train self._train() File "D:\指代消歧\fastNLP\fastNLP\core\trainer.py", line 668, in _train prediction = self._data_forward(self.model, batch_x) File "D:\指代消歧\fastNLP\fastNLP\core\trainer.py", line 761, in _data_forward y = network(*x) File "E:\Anaconda\lib\site-packages\torch\nn\modules\module.py", line 550, in call result = self.forward(input, **kwargs) File "D:\指代消歧\fastNLP\reproduction\coreference_resolution\model\model_re.py", line 563, in forward mention_speakers_ids, genre) File "D:\指代消歧\fastNLP\reproduction\coreference_resolution\model\model_re.py", line 262, in get_antecedents_score pair_emb = self.get_pair_emb(span_represent, antecedents, mention_speakers_ids, genre) # [span_num,max_ant,emb] File "D:\指代消歧\fastNLP\reproduction\coreference_resolution\model\model_re.py", line 313, in get_pair_emb index=antecedents.unsqueeze(2).expand(num_span, max_ant, emb_dim)) RuntimeError: index 4294967296 is out of bounds for dimension 1 with size 130

Xiaoxiong-Liu commented 3 years ago

主要requirement: prettytable==0.7.2 allennlp==0.8.2 scikit-learn==0.22.2 pyhocon==0.3.50 torch==1.1.0

Xiaoxiong-Liu commented 3 years ago

已修复,可下载最新代码。