Code for our SIGIR 2018 paper "Improving Sequential Recommendation with Knowledge-Enhanced Memory Networks". See the paper: https://dl.acm.org/citation.cfm?id=3209978.3210017
29
stars
5
forks
source link
复现代码时出现bug:IndexError: index 3552 is out of bounds for size 3170 #1
bug如下:
Traceback (most recent call last):
File "run_KSR.py", line 121, in
gru.fit(data, ItemEmbedding, KBItemEmbedding, r_matrix)
File "./src/KVMN4rec.py", line 653, in fit
cost = train_function(in_idx, y)
File "/home/zsj/anaconda3/envs/cgj/lib/python2.7/site-packages/theano/compile/function_module.py", line 898, in call
storage_map=getattr(self.fn, 'storage_map', None))
File "/home/zsj/anaconda3/envs/cgj/lib/python2.7/site-packages/theano/gof/link.py", line 325, in raise_with_op
reraise(exc_type, exc_value, exc_trace)
File "/home/zsj/anaconda3/envs/cgj/lib/python2.7/site-packages/theano/compile/function_module.py", line 884, in call
self.fn() if output_subset is None else\
IndexError: index 3552 is out of bounds for size 3170
Apply node that caused the error: AdvancedSubtensor1(<TensorType(float32, matrix)>, Reshape{1}.0)
Toposort index: 41
Inputs types: [TensorType(float32, matrix), TensorType(int32, vector)]
Inputs shapes: [(3170, 320), (2200,)]
Inputs strides: [(1280, 4), (4,)]
Inputs values: ['not shown', 'not shown']
Outputs clients: [[Reshape{2}(AdvancedSubtensor1.0, MakeVector{dtype='int64'}.0)]]
Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer):
File "run_KSR.py", line 121, in
gru.fit(data, ItemEmbedding, KBItemEmbedding, r_matrix)
File "./src/KVMN4rec.py", line 601, in fit
H_new, MN_new, Y_pred, sampled_params = self.model(X, self.H, self.MN, Y, self.dropout_p_hidden, self.dropout_p_embed)
File "./src/KVMN4rec.py", line 529, in model
Sy = self.MergeE[Y] #shape:n*(dim+d) 其中n为候选物品数量
HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.
bug如下: Traceback (most recent call last): File "run_KSR.py", line 121, in
gru.fit(data, ItemEmbedding, KBItemEmbedding, r_matrix)
File "./src/KVMN4rec.py", line 653, in fit
cost = train_function(in_idx, y)
File "/home/zsj/anaconda3/envs/cgj/lib/python2.7/site-packages/theano/compile/function_module.py", line 898, in call
storage_map=getattr(self.fn, 'storage_map', None))
File "/home/zsj/anaconda3/envs/cgj/lib/python2.7/site-packages/theano/gof/link.py", line 325, in raise_with_op
reraise(exc_type, exc_value, exc_trace)
File "/home/zsj/anaconda3/envs/cgj/lib/python2.7/site-packages/theano/compile/function_module.py", line 884, in call
self.fn() if output_subset is None else\
IndexError: index 3552 is out of bounds for size 3170
Apply node that caused the error: AdvancedSubtensor1(<TensorType(float32, matrix)>, Reshape{1}.0)
Toposort index: 41
Inputs types: [TensorType(float32, matrix), TensorType(int32, vector)]
Inputs shapes: [(3170, 320), (2200,)]
Inputs strides: [(1280, 4), (4,)]
Inputs values: ['not shown', 'not shown']
Outputs clients: [[Reshape{2}(AdvancedSubtensor1.0, MakeVector{dtype='int64'}.0)]]
Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer): File "run_KSR.py", line 121, in
gru.fit(data, ItemEmbedding, KBItemEmbedding, r_matrix)
File "./src/KVMN4rec.py", line 601, in fit
H_new, MN_new, Y_pred, sampled_params = self.model(X, self.H, self.MN, Y, self.dropout_p_hidden, self.dropout_p_embed)
File "./src/KVMN4rec.py", line 529, in model
Sy = self.MergeE[Y] #shape:n*(dim+d) 其中n为候选物品数量
HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.
我下载的是博主您提供的ml-1m预处理好的数据集,但是在复现运行代码时出现以上错误,尝试打印输出但还是看不出哪里有问题。因此请求博主的帮助解答!Thanks♪(・ω・)ノ