Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault #394

Open
LoneChristmas opened this issue Jun 12, 2023 · 6 comments
Open

Segmentation fault #394

LoneChristmas opened this issue Jun 12, 2023 · 6 comments

Comments

@LoneChristmas
Copy link

我尝试采用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
Copy link
Author

抱歉再来打扰一下,我执行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
Copy link

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

@Aipura
Copy link

Aipura commented Oct 10, 2023

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
Copy link

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

@galaxywwww
Copy link

请问怎么解决Segmentation fault错误呢

@galaxywwww
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants