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

Running KGAT on Customized Dataset #42

Open
liyy2 opened this issue Dec 14, 2020 · 18 comments
Open

Running KGAT on Customized Dataset #42

liyy2 opened this issue Dec 14, 2020 · 18 comments

Comments

@liyy2
Copy link

liyy2 commented Dec 14, 2020

When I trying to run KGAT on a customized dataset, I get this error
GAT-lyy) yunyangli@UBUNTU1604-R940xa:~/knowledge_graph_attention_network/Model$ python Main.py --model_type kgat --alg_type bi --dataset sl --regs [1e-5,1e-5] --layer_size [64,32,16] --embed_size 64 --lr 0.0001 --epoch 1000 --verbose 50 --save_flag 1 --pretrain -1 --batch_size 1024 --node_dropout [0.1] --mess_dropout [0.1,0.1,0.1] --use_att True --use_kge True [n_users, n_items]=[3234, 96393] [n_train, n_test]=[26379, 26187] [n_entities, n_relations, n_triples]=[96397, 27, 4462966] [batch_size, batch_size_kg]=[1024, 178518] convert ratings into adj mat done. convert 50 relational triples into adj mat done. @1.6183s /home/yunyangli/knowledge_graph_attention_network/Model/utility/loader_kgat.py:87: RuntimeWarning: divide by zero encountered in power d_inv = np.power(rowsum, -1).flatten() generate si-normalized adjacency matrix. reordering indices... reorganize all kg data done. sort meta-data done. sort all data done. using xavier initialization #params: 6611344 without pretraining. Traceback (most recent call last): File "Main.py", line 269, in <module> A_batch_data = data_generator.generate_train_A_batch() File "/home/yunyangli/knowledge_graph_attention_network/Model/utility/loader_kgat.py", line 254, in generate_train_A_batch heads, relations, pos_tails, neg_tails = self._generate_train_A_batch() File "/home/yunyangli/knowledge_graph_attention_network/Model/utility/loader_kgat.py", line 190, in _generate_train_A_batch heads = [rd.choice(exist_heads) for _ in range(self.batch_size_kg)] File "/home/yunyangli/knowledge_graph_attention_network/Model/utility/loader_kgat.py", line 190, in <listcomp> heads = [rd.choice(exist_heads) for _ in range(self.batch_size_kg)] File "/home/yunyangli/.conda/envs/KGAT-lyy/lib/python3.6/random.py", line 261, in choice return seq[i] TypeError: 'dict_keys' object does not support indexing

When running the provided dataset, it's fine. However, when turning into my dataset, I get this weird error. I am running this on python 3.6.3, and everything else is the same as the specified environment.

@haotiandouluo
Copy link

您好,自己的数据集怎么生成train.txt和test.txt还有kg_final.txt?

@yinwang11
Copy link

您好,自己的数据集怎么生成train.txt和test.txt还有kg_final.txt?

您好,您的问题解决了吗?我也想了解这个问题

@haotiandouluo
Copy link

haotiandouluo commented May 21, 2024 via email

@Geeker-LStar
Copy link

大哥,这是我去年11月12月份问的吧,我这个毕设都做完答辩完过了快半年了呀,现在问,是不是有点晚了呀?这个我就是自己写代码就自己匹配,我相信你应该看的懂原始数据集的那些编号是什么意思,当时也是自己写代码,用自己的数据集一个一个匹配。

---Original--- From: @.> Date: Tue, May 21, 2024 19:27 PM To: @.>; Cc: @.@.>; Subject: Re: [xiangwang1223/knowledge_graph_attention_network] Running KGAT onCustomized Dataset (#42) 您好,自己的数据集怎么生成train.txt和test.txt还有kg_final.txt? 您好,您的问题解决了吗?我也想了解这个问题 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

大佬您还有数据预处理的代码嘛...就是怎么把原始数据集变成符合模型要求的数据集....谢谢大佬! @haotiandouluo

@haotiandouluo
Copy link

haotiandouluo commented Jul 25, 2024 via email

@Geeker-LStar
Copy link

aaaa 好的!!!!(你敲那些代码大概用了多久..?跑完所有实验又用了多久呀?
我不是毕设,我在做论文的对比试验,快截稿了..(捂脸

@Geeker-LStar
Copy link

@haotiandouluo

@haotiandouluo
Copy link

haotiandouluo commented Jul 25, 2024 via email

@Geeker-LStar
Copy link

!!!能问一下您用的 GPU 配置是什么嘛..因为我可能从写代码到处理完数据到跑完只有三天时间........

@haotiandouluo
Copy link

haotiandouluo commented Jul 25, 2024 via email

@Geeker-LStar
Copy link

好的!谢谢大佬~!

@Geeker-LStar
Copy link

大佬,问一个比较细节的问题。自己写代码的话会涉及到数据集和 freebase 的映射,对吗?这个映射需要自己去获得~?
感谢!!!
@haotiandouluo

@haotiandouluo
Copy link

haotiandouluo commented Jul 25, 2024 via email

@Geeker-LStar
Copy link

a...我好像没有太理解诶.....(可能我比较笨呜呜呜。。。
就是就是,它不是需要在 freebase 做映射吗,为什么说不用管 freebase 呀?
我比较好奇,它的关系(relation)和实体(entity)是怎么从 freebase 得到映射的?如果不用 freebase,那怎么得到 relation 和 entity 和最终的三元组?

谢谢大佬!!!!

@Geeker-LStar
Copy link

@haotiandouluo

@haotiandouluo
Copy link

haotiandouluo commented Jul 25, 2024 via email

@Geeker-LStar
Copy link

emmmm 我想我理解了一点...所以您用的什么数据集+什么freebase?~
谢谢啦!❤

@haotiandouluo
Copy link

haotiandouluo commented Jul 25, 2024 via email

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

4 participants