RUCAIBox / RecBole

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

[🐛BUG] Evaluation metric not logging to WandB #1759

Open thijsjls opened 1 year ago

thijsjls commented 1 year ago

Describe the bug Evaluation metrics are not logging to WandB

To Reproduce My configuration:

  'log_wandb': True,
  'wandb_project': "advanced_baseline_training",
  'data_path': "drive/My Drive/Colab Notebooks/aaa_project_thijs_sluijter/dataset/",
  'checkpoint_dir': "drive/My Drive/Colab Notebooks/aaa_project_thijs_sluijter/saved/" + model_name,
  'gpu_id': 1,
  'load_col': { "inter": ["user_id", "item_id", "timestamp"] },
  'train_neg_sample_args': None,
  'epochs': 50,
  'eval_step': 2,
  'eval_args': {'split': {'RS': [0.8, 0.1, 0.1]}, 'order': 'TO', 'mode': 'full', 'group_by': 'user'},
  'metrics': ["Recall", "MRR", "NDCG", "Hit", "Precision", "MAP"],
  'topk': [1, 5, 10]

Expected behavior As indicated in the user guide WandB should log evaluation metrics. However it only logs train loss.

Screenshots

image

Desktop (please complete the following information):

Wicknight commented 1 year ago

Hello @thijsjls !

I just ran RecBole with your settings on ml-100k dataset and BPR model, and everything is fine. I think you should check if your trainer code is consistent with ours: recbole/trainer/trainer.py. Here at line 494 of the code, we log the evaluation metrics to wandb and it works for me.