The following line of code gives me the above error in Keras. model is a Graph model in Keras.
score, acc = model.evaluate({
'input1': X_test1,
'input2': X_test2,
'output':Y_test}, batch_size=450)
but when I change it to the following, it runs fine.
predictions = model.predict({
'input1': X_test1,
'input2': X_test2}, batch_size=450)['output']
The Y_test here is a <type 'numpy.ndarray'>
of <type 'numpy.ndarray'>
. A one-hot encoded vector.
Sample Y_test
:
[[1.,0.,0.],[1.,0.,0.],[0.,0.,1.]]
As you can see here :
https://github.com/fchollet/keras/blob/master/keras/engine/training.py
The evaluate method returns only test loss (or losses). So assigning result of this method to a pair results in error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With