Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: Unrecognized keyword arguments: {'show_accuracy': True} #yelp challenge dataset

File "/home/susheel/LearnPython/local/lib/python2.7/site-packages/keras/models.py", line 848, in fit raise TypeError('Unrecognized keyword arguments: ' + str(kwargs)) TypeError: Unrecognized keyword arguments: {'show_accuracy': True}

While I am trying to find the sentiment on Yelp Data Academic.json using CNN in deep learning. I am getting the above error I treid its coming in numpy error but i didnt resolved can anyone help how can

like image 384
Susheel Avatar asked Sep 08 '17 11:09

Susheel


1 Answers

If you want to print the accuracy while training your model you do not need to specify it in model.fit but in the model.compile. Here you can set the metrics=['accuracy'] argument.

Example

model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
model.fit(X, Y, verbose=1)

EDIT:

In older versions of Keras (< 1) the argument show_accuracy=True does exist.


EDIT 2:

With tensorflow 2.0 keras is included. With this version you should use metrics=['acc'].

like image 172
Wilmar van Ommeren Avatar answered Nov 20 '22 14:11

Wilmar van Ommeren