cheniison / e2e-coref-pytorch

Bert for End-to-end Neural Coreference Resolution in Pytorch
24 stars 8 forks source link

运行报错 #7

Closed houliangxue closed 3 years ago

houliangxue commented 3 years ago

404 Client Error: Not Found for url: https://huggingface.co/data/checkpoint.transformer.max/resolve/main/config.json

请问这是什么原因,我在浏览器打开网址也找不到这个文件

cheniison commented 3 years ago

你是不是还没有训练模型。 "data/checkpoint.transformer.max" 是训练完成后 data/ 目录下的已微调的 transformer

houliangxue commented 3 years ago

哦,谢谢,明白了

houliangxue commented 3 years ago

还有运行train.py报错如下: Traceback (most recent call last): File "", line 1, in File "D:\PyCharm Community Edition 2020.2.3\plugins\python-ce\helpers\pydev_pydev_bundle\pydev_umd.py", line 197, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "D:\PyCharm Community Edition 2020.2.3\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "E:/e2e-coref-pytorch-master/train.py", line 171, in train() File "E:/e2e-coref-pytorch-master/train.py", line 107, in train top_antecedents_score, top_antecedents_index, top_m_spans_masks, top_m_spans_start, top_m_spans_end = coref_model(sentences_ids, sentences_masks, sentences_valid_masks, speaker_ids, sentence_map, subtoken_map, genre, transformer_model) File "E:\annconda\envs\e2e-coref-pytorch\lib\site-packages\torch\nn\modules\module.py", line 550, in call result = self.forward(*input, *kwargs) File "E:\e2e-coref-pytorch-master\model.py", line 239, in forward tokens_embed = sentences_embed[sentences_valid_masks.bool()] # num_tokens embed_dim TypeError: only integer tensors of a single element can be converted to an index

cheniison commented 3 years ago

可以检查一下 transformer 版本是否与 README.md 一致。也可以对代码进行调试,见 issue #5,若发现了代码中的错误,欢迎提 pull request 或在该 issue 下描述错误出现原因和解决方案。

houliangxue commented 3 years ago

可以检查一下 transformer 版本是否与 README.md 一致。也可以对代码进行调试,见 issue #5,若发现了代码中的错误,欢迎提 pull request 或在该 issue 下描述错误出现原因和解决方案。

谢谢,解决了

cheniison commented 3 years ago

可以发一下问题原因或解决方法吗?之后可能也会有人遇到相同的问题

houliangxue commented 3 years ago

可以发一下问题原因或解决方法吗?之后可能也会有人遇到相同的问题

哦,就是我的transformer版本不对