emnlp2017-relation-extraction icon indicating copy to clipboard operation
emnlp2017-relation-extraction copied to clipboard

TypeError: Input 'y' of 'Equal' Op has type float32 that does not match type int8 of argument 'x'.

Open moh-yani opened this issue 2 years ago • 0 comments

Dear,

I just tried to run:

python model_train.py model_ContextWeighted train ../data/wikipedia-wikidata/enwiki-20160501/semantic-graphs-filtered-training.02_06.json ../data/wikipedia-wikidata/enwiki-20160501/semantic-graphs-filtered-validation.02_06.json

However, I found this errors:

File "model_train.py", line 111, in callback_history = model.fit(train_as_indices[:-1], File "/root/anaconda3/envs/tensorflow2/lib/python3.8/site-packages/keras/utils/traceback_utils.py", line 67, in error_handler raise e.with_traceback(filtered_tb) from None File "/tmp/autograph_generated_file_k_0une1.py", line 15, in tf__train_function retval = ag_.converted_call(ag__.ld(step_function), (ag__.ld(self), ag__.ld(iterator)), None, fscope) File "/tmp/autograph_generated_filey2o5b9rl.py", line 10, in tf__masked_categorical_crossentropy mask = ag.converted_call(ag__.ld(K).equal, (ag__.ld(y_true)[(..., 0)], ag__.converted_call(ag__.ld(K).variable, (1,), None, fscope)), None, fscope) TypeError: in user code:

File "/root/anaconda3/envs/tensorflow2/lib/python3.8/site-packages/keras/engine/training.py", line 1051, in train_function  *
    return step_function(self, iterator)
File "/home/yani/disertasi/emnlp2017-relation-extraction/relation_extraction/core/keras_models.py", line 119, in masked_categorical_crossentropy  *
    mask = K.equal(y_true[..., 0], K.variable(1))
File "/root/anaconda3/envs/tensorflow2/lib/python3.8/site-packages/keras/backend.py", line 2925, in equal
    return tf.equal(x, y)

TypeError: Input 'y' of 'Equal' Op has type float32 that does not match type int8 of argument 'x'.

Anyone could help?

regards,

Mohammad

moh-yani avatar May 19 '22 06:05 moh-yani