RUCAIBox / RecBole

A unified, comprehensive and efficient recommendation library
https://recbole.io/
MIT License
3.37k stars 606 forks source link

[🐛BUG] Empty prediction tensor in some models. #1982

Open arseny239 opened 8 months ago

arseny239 commented 8 months ago

Hi,

First of all let me thank you for such a great library. I really like it! But I still have some problem(s):

Describe the bug I tried to train and use some models (CORE, SINE), everything goes ok while I am training it. But when I try to make a prediction, I get only empty tensor(s).

I use run_recbole to train the model, then I load it

config, model, dataset, train_data, valid_data, test_data = load_data_and_model(
    model_file='saved/file_name.pth',
)

and then check if the user is in dataset: assert 'user_name' in dataset.field2token_id[dataset.uid_field] and try to make the prediction:

cuser = dataset.token2id(dataset.uid_field, 'user_name') 
scores, topk_iid_list = full_sort_topk([cuser], model, test_data, k=10, device=config['device'])

But topk_iid_list is empty for ALL users!

At the same time, some other models, such as SASRec and SHAN, work well.

Am I doing something wrong or is it a bug in the model? What reasons could cause this behavior?

I work with my own dataset, I created the .item and .inter "ftomic files" (no .user file because I do not have any info about users - only id's)

I use recbole version 1.2.0 and Linux (Debian), without GPU (I train it on the CPU with 16 cores)

Thank you for the answer(s). Sincerely yours, Arseny