RelationPrediction icon indicating copy to clipboard operation
RelationPrediction copied to clipboard

Embedding error

Open svatoma1 opened this issue 5 years ago • 0 comments

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'])]

svatoma1 avatar Apr 30 '20 10:04 svatoma1