hidasib / GRU4Rec

GRU4Rec is the original Theano implementation of the algorithm in "Session-based Recommendations with Recurrent Neural Networks" paper, published at ICLR 2016 and its follow-up "Recurrent Neural Networks with Top-k Gains for Session-based Recommendations". The code is optimized for execution on the GPU.
Other
754 stars 223 forks source link

Testing Error:: start = offset_sessions[iters] IndexError: index 2 is out of bounds for axis 0 with size 2 #46

Closed TauraiUCB closed 2 years ago

TauraiUCB commented 2 years ago

Hi @hidasib

I have trained the model on a different dataset using CPU. I followed the CPU configuration instructions and everything worked fine. Training was completed successfully but after loading the testing data, the model could not evaluate and I got this error:

data = pd.read_csv(fname, sep='\t', usecols=[gru.session_key, gru.item_key, gru.time_key], dtype={gru.session_key:'int32', gru.item_key:np.str})
Starting evaluation (cut-off=1, using standard mode for tiebreaking)
Measuring Recall@1 and MRR@1
Traceback (most recent call last):
  File "run.py", line 129, in <module>
    res = evaluation.evaluate_gpu(gru, test_data, items, batch_size=100, cut_off=c, mode=args.eval_type)
  File "/Users/xxxxxxxx/GRU4REC/GRU4Rec/evaluation.py", line 80, in evaluate_gpu
    start = offset_sessions[iters]
IndexError: index 2 is out of bounds for axis 0 with size 2

What could be causing this problem and how can I fix it?

Thanks

LouHerGetUp commented 1 month ago

Hi @hidasib

I have trained the model on a different dataset using CPU. I followed the CPU configuration instructions and everything worked fine. Training was completed successfully but after loading the testing data, the model could not evaluate and I got this error:

data = pd.read_csv(fname, sep='\t', usecols=[gru.session_key, gru.item_key, gru.time_key], dtype={gru.session_key:'int32', gru.item_key:np.str})
Starting evaluation (cut-off=1, using standard mode for tiebreaking)
Measuring Recall@1 and MRR@1
Traceback (most recent call last):
  File "run.py", line 129, in <module>
    res = evaluation.evaluate_gpu(gru, test_data, items, batch_size=100, cut_off=c, mode=args.eval_type)
  File "/Users/xxxxxxxx/GRU4REC/GRU4Rec/evaluation.py", line 80, in evaluate_gpu
    start = offset_sessions[iters]
IndexError: index 2 is out of bounds for axis 0 with size 2

What could be causing this problem and how can I fix it?

Thanks

Hi, can you tell me how you solved this problem? I'm having the same problem.