yao8839836 / kg-bert

KG-BERT: BERT for Knowledge Graph Completion
Apache License 2.0
679 stars 141 forks source link

请问为什么我在本地运行时会报unicode error? #43

Open KNLYE opened 6 months ago

KNLYE commented 6 months ago

在我的本地部署之后,使用FB15K-237运行代码时,出现了如下报错 02/05/2024 14:55:04 - INFO - main - device: cpu n_gpu: 0, distributed training: False, 16-bits training: False 02/05/2024 14:55:05 - INFO - pytorch_pretrained_bert.tokenization - loading vocabulary file https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-cased-vocab.txt from cache at C:\Users\KNLYE.pytorch_pretrained_bert\5e8a2b4893d13790ed4150ca1906be5f7a03d6c4ddf62296c383f6db42814db2.e13dbb970cb325137 Traceback (most recent call last): File "D:\PythonHome\Graduation Code\kg-bert-master\run_bert_link_prediction.py", line 1060, in main() File "D:\PythonHome\Graduation Code\kg-bert-master\run_bert_link_prediction.py", line 564, in main File "D:\PythonHome\Graduation Code\kg-bert-master\run_bert_link_prediction.py", line 119, in get_train_examples return self._create_examples( File "D:\PythonHome\Graduation Code\kg-bert-master\run_bert_link_prediction.py", line 173, in _create_examples ent_lines = f.readlines() UnicodeDecodeError: 'gbk' codec can't decode byte 0x90 in position 1518: illegal multibyte sequence 我尝试将entity2text另存为gbk或utf-8格式,问题仍未解决 python版本为3.9