LunaBlack / KGAT-pytorch

328 stars 72 forks source link

运行python main_nfm.py --model_type fm --data_name amazon-book报错 #27

Open Hechilai opened 8 months ago

Hechilai commented 8 months ago

(relation_embed): Embedding(80, 64) (entity_user_embed): Embedding(184166, 64) File "D:\Graduate\Codes\Knowledge Graph recommend\KGAT-pytorch-master\main_ecfkg.py", line 116, in train batch_head, batch_relation, batch_pos_tail, batch_neg_tail = data.generate_kg_batch(data.train_kg_dict, data.train_batch_size, data.n_users_entities) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Graduate\Codes\Knowledge Graph recommend\KGAT-pytorch-master\data_loader\loader_base.py", line 153, in generate_kg_batch batch_head = random.sample(exist_heads, batch_size) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\SoftWares\Python3.12.0\Lib\random.py", line 413, in sample raise TypeError("Population must be a sequence. " TypeError: Population must be a sequence. For dicts or sets, use sorted(d).

Hechilai commented 8 months ago

已解决https://blog.csdn.net/baidu_41797613/article/details/121020892