MichSchli / RelationPrediction

Implementation of R-GCNs for Relational Link Prediction
MIT License
435 stars 103 forks source link

Embedding error #13

Open svatoma1 opened 4 years ago

svatoma1 commented 4 years ago

When using a dataset with more relations than constants (e.g. Nations) the following error raises:

InvalidArgumentError (see above for traceback): indices[3] = 16 is not in [0, 16) [[Node: embedding_lookup_1 = Gather[Tindices=DT_INT32, Tparams=DT_FLOAT, _class=["loc:@Variable"], validate_indices=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](Variable/read, strided_slice_1)]]

It's a slightly extended Toy dataset (adding new 9 relations). It's most likely caused by restricting embedding's lookup values by the number of entities (which is, in this case, lower than the number of relations). Is this fix appropriate?

file: common/model_builder.py line: 28 & 29 input_shape = [max(int(encoder_settings['EntityCount']),int(encoder_settings['RelationCount'])), int(encoder_settings['CodeDimension'])]