awslabs / dgl-ke

High performance, easy-to-use, and scalable package for learning large-scale knowledge graph embeddings.
https://dglke.dgl.ai/doc/
Apache License 2.0
1.28k stars 196 forks source link

tensor size error #236

Open lazy-cong opened 3 years ago

lazy-cong commented 3 years ago

Hello, I try to use dgl-ke to train RotatE, but the program cannot be executed. I want to know why, my training command are as follows:

dglke_train --model_name RotatE --dataset FB15k --batch_size 1000 --neg_sample_size 200 --hidden_dim 400 \ --gamma 16.0 --lr 0.01 --max_step 500 --log_interval 100 --batch_size_eval 16 --test -adv \ --regularization_coef 1.00E-07 --num_thread 1 --num_proc 48

and the error:

File "dgl-ke-master\dgl-ke-master\python\dglke\models\pytorch\score_fun.py", line 470, in edge_func re_score = re_head re_rel - im_head im_rel RuntimeError: The size of tensor a (200) must match the size of tensor b (400) at non-singleton dimension 1

How can i solve this?

classicsong commented 3 years ago

You may need to add --double_ent this argument.