I am following the example from https://www.tensorflow.org/alpha/tutorials/load_data/text to load my own dataset and run binary classification on the sentences there (TensorFlow 2.0). The only change I've made to the example is the dataset being used (which I took from https://github.com/UKPLab/emnlp2017-claim-identification/tree/master/src/main/python), and since the labels can be only 0 or 1 I changed the loss function to binary_crossentropy and the optimizer to RMSprop. When fitting the Keras model which is identical to the model proposed in the tutorial, I'm constantly receiving the following error:

2019-04-29 13:51:15.609297: E tensorflow/core/grappler/optimizers/meta_optimizer.cc:495] constant folding failed: Invalid argument: Unsupported type: 21
2019-04-29 13:51:15.882000: E tensorflow/core/grappler/optimizers/meta_optimizer.cc:495] constant folding failed: Invalid argument: Unsupported type: 21

The fitting process is still advancing between those prints as evident from:

662/4508 [===>..........................] - ETA: 9:35 - loss: 11.0703 - accuracy: 0.2780

but instead of minimizing the loss, it seems to actually be maximizing it, with the accuracy going down after each iteration. (In fact, if the accuracy metric is correct, it would be a pretty good classifier if I just take not [prediction]). Is there anyone here who can explain to me what is the meaning of this error, and whether it's related to the strange behavior of the model (and hopefully how to fix it)? I've been trying to look for similar errors but couldn't find any. Thanks!

0 Answers