RUCAIBox / RecBole

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

LightGCN and MF model are not working #2090

Open emrulhasan-nlp opened 2 months ago

emrulhasan-nlp commented 2 months ago

Describe the bug I am trying to run some models. I have been able to successfully run ItemkNN, SLIMElastic, and BPR. However, when I want to run for LightGCN, it give the following error.

Error: Traceback (most recent call last): File "/content/RecBole/run_recbole.py", line 46, in run( File "/content/RecBole/recbole/quick_start/quick_start.py", line 52, in run res = run_recbole( File "/content/RecBole/recbole/quick_start/quick_start.py", line 137, in run_recbole model = get_model(config["model"])(config, train_data._dataset).to(config["device"]) File "/content/RecBole/recbole/model/general_recommender/lightgcn.py", line 76, in init self.norm_adj_matrix = self.get_norm_adj_mat().to(self.device) File "/content/RecBole/recbole/model/general_recommender/lightgcn.py", line 111, in get_norm_adj_mat A._update(data_dict) AttributeError: 'dok_matrix' object has no attribute '_update'. Did you mean: 'update'?

similarly for MF, I get the following error: Error: ValueError: model_name [MF] is not the name of an existing model.

Attached screenshot for both the errors. Thanks in advance LightGCN MF

downeykking commented 1 day ago

In Spicy, dok_matrix no longer allows update. You can change the code

A._update(data_dict)

to

for (row, col), value in data_dict.items():
    A[row, col] = value

which directly assigns values to A from data_dict.