rn5l / session-rec

Python-based framework for building and evaluating session-based and session-aware recommender systems.
382 stars 78 forks source link

Index out of Bounds Error for Session-Aware Recommendation (Opt and Single Mode) #24

Open matthewyangcs opened 2 years ago

matthewyangcs commented 2 years ago

Using a config file based off of the example_session_aware_opt.yml. This error persists with many different models, but I am currently working with hgru4rec.py.

My data set is labeled with the default headers of [SessionId, ItemId, Time, UserId], and I have ensured there are no new new items or users in the valid/test set.

Any help would be appreciated.

- class: hgru4rec.hgru4rec.HGRU4Rec
  params: {
    n_epochs: 1, 
    session_layers: 10,
    user_layers: 10,
    loss: 'top1'
  }
START evaluation of  10000  actions in  5000  sessions
    eval process:  0  of  10000 actions:  0.0  % in 0.08836889266967773 s
Traceback (most recent call last):
  File "run_config.py", line 62, in main
    run_file(c)
  File "run_config.py", line 169, in run_file
    run_opt(conf)
  File "run_config.py", line 417, in run_opt
    run_opt_single(conf, i, globals)
  File "run_config.py", line 277, in run_opt_single
    eval_algorithm(train, test, k, a, evaluation, metrics, results, conf, iteration=iteration, out=False)
  File "run_config.py", line 515, in eval_algorithm
    results[key] = eval.evaluate_sessions(algorithm, metrics, test, train)
  File "<arbitrary_path>/session-rec/evaluation/evaluation_user_based.py", line 170, in evaluate_sessions
    m.add(preds, rest[0], for_item=current_item, session=current_session, position=position)
IndexError: index 0 is out of bounds for axis 0 with size 0
saraLatifi commented 2 years ago

hi, could you please share your data? also did you try to run the experiment with other models or baselines?