yusanshi / news-recommendation

Implementations of some methods in news recommendation.
MIT License
241 stars 50 forks source link

hifiark验证时出现概率计算的输入维度问题 #26

Closed Lxhnnn closed 2 years ago

Lxhnnn commented 2 years ago

Calculating probabilities: 0%| | 0/1759 [00:00<?, ?it/s] Traceback (most recent call last): File "evaluate.py", line 434, in auc, mrr, ndcg5, ndcg10 = evaluate_total(model, directory) # 没有标签 File "/home/ant/.conda/envs/lxh1/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 49, in decorate_no_grad return func(*args, *kwargs) File "evaluate.py", line 272, in evaluate_total user_vector) File "/data/lxh/Ant_Rec/Algorithm_test/news-recommendation-master/src/model/HiFiArk/init.py", line 107, in get_prediction user_archive_vector.unsqueeze(dim=0)) File "/home/ant/.conda/envs/lxh1/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call result = self.forward(input, **kwargs) File "/data/lxh/Ant_Rec/Algorithm_test/news-recommendation-master/src/model/general/attention/similarity.py", line 22, in forward candidate_vector, wrt_vector.unsqueeze(dim=2)).squeeze(dim=2), RuntimeError: invalid argument 7: expected 3D tensor at /opt/conda/conda-bld/pytorch_1579040055865/work/aten/src/THC/generic/THCTensorMathBlas.cu:543

yusanshi commented 2 years ago

抱歉在这个 repo 的新版本(https://github.com/yusanshi/news-recommendation/tree/dev,虽然现在还是 work in progress)中,Hifi-Ark 已经被删去,主要原因是当时的实现有些问题,你这里报的错应该就是因为那些问题没有解决,次要原因是 Hifi-Ark 的模型结构相对比较”脏”一些,个人不打算继续维护它。

望理解