HarryShomer / KG-Mixup

Implementation of the WWW'23 paper "Toward Degree Bias in Embedding-Based Knowledge Graph Completion"
https://arxiv.org/abs/2302.05044
17 stars 1 forks source link

Thanks for sharing your work, but the model source code seems to have a bug. #1

Closed 2391134843 closed 1 year ago

2391134843 commented 1 year ago

Epoch 1: 0%| | 0/1169 [00:01<?, ?it/s] Traceback (most recent call last): File "src/main.py", line 186, in main() File "src/main.py", line 182, in main run_model(model, optimizer, data) File "src/main.py", line 169, in run_model model_trainer.fit(args.epochs, synth_gen, *train_fit_keywords) File "/home/admin1/code/lly/2023-4/Mix/KG-Mixup/src/training.py", line 122, in fit loss = self._train_batch(batch, train_type, label_smooth) File "/home/admin1/code/lly/2023-4/Mix/KG-Mixup/kgpy/kgpy/training.py", line 193, in _train_batch batch_loss = self._train_batch_1_to_n(batch, label_smooth) File "/home/admin1/code/lly/2023-4/Mix/KG-Mixup/kgpy/kgpy/training.py", line 271, in _train_batch_1_to_n all_scores = self.model(trips, mode="tail") File "/home/admin1/anaconda3/envs/torch10/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(input, **kwargs) File "/home/admin1/code/lly/2023-4/Mix/KG-Mixup/kgpy/kgpy/models/base/base_emb_model.py", line 239, in forward scores = self.score_tail(triplets) File "/home/admin1/code/lly/2023-4/Mix/KG-Mixup/kgpy/kgpy/models/conve.py", line 184, in score_tail return self.score_head(triplets) File "/home/admin1/code/lly/2023-4/Mix/KG-Mixup/kgpy/kgpy/models/conve.py", line 164, in score_head x = torch.mm(x, self.ent_embs.weight.transpose(1,0)) RuntimeError: CUDA error: CUBLAS_STATUS_INVALID_VALUE when calling cublasSgemm( handle, opa, opb, m, n, k, &alpha, a, lda, b, ldb, &beta, c, ldc)

HarryShomer commented 1 year ago

@2391134843

Thanks for bringing this to my attention.

Could you share the command you're running?

2391134843 commented 1 year ago

Sorry, it was my mistake that led to this problem, based on StarE and the author of your paper model. I have this problem every time I try it. The reason is that the Python version is not correct. Python version must be >3.7. The bug disappeared after I used 3.8 and 3.9.