thunlp / OpenKE

An Open-Source Package for Knowledge Embedding (KE)
3.77k stars 984 forks source link

Segmentation fault #394

Open LoneChristmas opened 1 year ago

LoneChristmas commented 1 year ago

我尝试采用https://github.com/yuyuz/MetaQA这个数据集里面的kb.txt(三元组(h,r,t))和python代码构建: entity2id.txt relation2id.txt train2id.txt test2id.txt valid2id.txt这几个文件, 我发现kb.txt里面有重复的三元组,我将重复的三元组删除了并且也严格对应要求的(e1,e2,r)对格式进行了修改,而且采用'\t'进行分隔,但还是会报错:Segmentation fault,烦请各位前辈告诉我可能的原因,谢谢!

LoneChristmas commented 1 year ago

抱歉再来打扰一下,我执行train_rotate_WN18RR_adv.py(openke自带的rotate例子)的时候会出现:Finish initializing... 0%| | 0/1500 [00:00<?, ?it/s] Traceback (most recent call last): File "/mnt/d/learning/kgqa/KGQA-master/OpenKE/train_rotate.py", line 47, in trainer.run() File "/mnt/d/learning/kgqa/KGQA-master/OpenKE/openke/config/Trainer.py", line 94, in run loss = self.train_one_step(data) File "/mnt/d/learning/kgqa/KGQA-master/OpenKE/openke/config/Trainer.py", line 53, in train_one_step loss.backward() File "/home/stone/.local/lib/python3.10/site-packages/torch/_tensor.py", line 487, in backward torch.autograd.backward( File "/home/stone/.local/lib/python3.10/site-packages/torch/autograd/init.py", line 200, in backward Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass RuntimeError: CUDA error: unknown error Compile with TORCH_USE_CUDA_DSA to enable device-side assertions. 这样的情况,想问一下这个是由于cuda和pytorch版本对不上的问题吗?我用的是wsl+ubuntu,但是运行其他模型的训练例子代码都没什么问题,想请教一下有没有什么解决的思路。

hp962183985 commented 11 months ago

我也有segmentation fault的错误,请问你是怎么解决的?存储格式也是按照examples里数据集改的

Aipura commented 9 months ago

train_dataloader = TrainDataLoader( in_path = "./benchmarks/MetaQA/TransE/", nbatches = 100, threads = 8, sampling_mode = "normal", bern_flag = 1, filter_flag = 1, neg_ent = 25, neg_rel = 0)

add "/" at the end of in_path line, and then solved the Segmentation fault problem.

rascalvain commented 4 months ago

Aipura‘s suggestion is so helpful.Thank you so much!

galaxywwww commented 1 month ago

请问怎么解决Segmentation fault错误呢

galaxywwww commented 1 month ago

我在in_path后面加了/还是报错