jun-zeng/ShadeWatcher

A question about the dataset

Closed this issue · 2 comments

ZCXu1 commented

Are there any requirements for the data set? I mean concretely inter2id.txt and train2id.txt. I successfully ran the recommending codes on one of my data sets, but failed the other one. I tried to solve the bug but failed. The error is tensorflow.python.framework.errors_impl.InvalidArgumentError, concretely:

Traceback (most recent call last):
File "/home/xzc/.virtualenvs/shadewatcher/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1356, in _do_call
return fn(*args)
File "/home/xzc/.virtualenvs/shadewatcher/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1341, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/home/xzc/.virtualenvs/shadewatcher/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1429, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[4] = 7 is not in [0, 7)
[[{{node embedding_lookup_10}}]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "driver.py", line 203, in
main()
File "driver.py", line 119, in main
model.update_attentive_A(sess)
File "/home/xzc/ShadeWatcher/recommend/model/GNN.py", line 711, in update_attentive_A
A_kg_score = sess.run(self.A_kg_score, feed_dict=feed_dict)
File "/home/xzc/.virtualenvs/shadewatcher/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 950, in run
run_metadata_ptr)
File "/home/xzc/.virtualenvs/shadewatcher/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1173, in _run
feed_dict_tensor, options, run_metadata)
File "/home/xzc/.virtualenvs/shadewatcher/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1350, in _do_run
run_metadata)
File "/home/xzc/.virtualenvs/shadewatcher/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1370, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[4] = 7 is not in [0, 7)
[[node embedding_lookup_10 (defined at /home/xzc/ShadeWatcher/recommend/model/GNN.py:509) ]]
Errors may have originated from an input operation.
Input Source operations connected to node embedding_lookup_10:
r (defined at /home/xzc/ShadeWatcher/recommend/model/GNN.py:116)
rel_embed/read (defined at /home/xzc/ShadeWatcher/recommend/model/GNN.py:145)
Original stack trace for 'embedding_lookup_10':
File "driver.py", line 203, in
main()
File "driver.py", line 54, in main
model = GNN(args=args, meta_data=meta_data, pretrain_embedding=pretrain_embedding)
File "/home/xzc/ShadeWatcher/recommend/model/GNN.py", line 44, in init
self._build_transr_model()
File "/home/xzc/ShadeWatcher/recommend/model/GNN.py", line 422, in _build_transr_model
self.A_kg_score = self._generate_transR_score(h=self.h, t=self.neg_t, r=self.r)
File "/home/xzc/ShadeWatcher/recommend/model/GNN.py", line 509, in _generate_transR_score
r_e = tf.nn.embedding_lookup(self.weights['rel_embed'], r)
File "/home/xzc/.virtualenvs/shadewatcher/lib/python3.6/site-packages/tensorflow/python/ops/embedding_ops.py", line 315, in embedding_lookup
transform_fn=None)
File "/home/xzc/.virtualenvs/shadewatcher/lib/python3.6/site-packages/tensorflow/python/ops/embedding_ops.py", line 133, in _embedding_lookup_and_transform
array_ops.gather(params[0], ids, name=name), ids, max_norm)
File "/home/xzc/.virtualenvs/shadewatcher/lib/python3.6/site-packages/tensorflow/python/util/dispatch.py", line 180, in wrapper
return target(*args, **kwargs)
File "/home/xzc/.virtualenvs/shadewatcher/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 3475, in gather
return gen_array_ops.gather_v2(params, indices, axis, name=name)
File "/home/xzc/.virtualenvs/shadewatcher/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 4097, in gather_v2
batch_dims=batch_dims, name=name)
File "/home/xzc/.virtualenvs/shadewatcher/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/home/xzc/.virtualenvs/shadewatcher/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/home/xzc/.virtualenvs/shadewatcher/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3616, in create_op
op_def=op_def)
File "/home/xzc/.virtualenvs/shadewatcher/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2005, in init
self._traceback = tf_stack.extract_stack()

Here are my data sets
fail.zip
success.zip

ZCXu1 commented

I found that if inter2id.txt is big enough, there is no bug.

Nice. Thanks for the information.