Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "show_accuracy" argument is deprecated #56

Closed
jdelange opened this issue Dec 10, 2016 · 11 comments
Closed

The "show_accuracy" argument is deprecated #56

jdelange opened this issue Dec 10, 2016 · 11 comments

Comments

@jdelange
Copy link

C:\Program Files\Anaconda2\lib\site-packages\keras\models.py:635: UserWarning:
he "show_accuracy" argument is deprecated, instead you should pass the "accurac
" metric to the model at compile time:
model.compile(optimizer, loss, metrics=["accuracy"])
warnings.warn('The "show_accuracy" argument is deprecated, '

In your example application:

model.fit(X_train, Y_train,
              batch_size={{choice([64, 128])}},
              nb_epoch=1,
              show_accuracy=True,
              verbose=2,
              validation_data=(X_test, Y_test))
@isrugeek
Copy link

@jdelange How did you fix this issue i also got this Issue in my Project ( Not this Code)
Thanks in Advance

@jdelange
Copy link
Author

jdelange commented Jan 30, 2017

@isrugeek As noted above: replace the show_accuracy=True statement with metrics=['accuracy'] I'm not sure exactly where this applies, but it is either in the code you are writing, or it is in existing (example) code in Keras/Hyperas if it has not yet been fixed. Note: I had too many issues with Hyperas, I used Hyperopt instead.

@isrugeek
Copy link

@jdelange Thanks but after i changed it shows me another error

TypeError: Received unknown keyword arguments: {'metrics': ['accuracy']}

@jdelange
Copy link
Author

@isrugeek Sorry, can't see what you are doing. The syntax provided is correct, so the call may not be applicable/available in your case? Sounds quite basic. Not sure how experienced you are. Have a look at this site Machine learning mastery lots of basic examples to get started. Helped me a lot.

@isrugeek
Copy link

@jdelange Thanks buddy. i am confused because it works on my different machine and not on MacBook . any how i fixed the problem by edit the Model.py( Keras File) by comparing my Old machine.

Thanks

@JAStark
Copy link

JAStark commented Feb 19, 2017

The issue arises from:
model.fit(X_train, y_train_ohe, nb_epoch=50, batch_size=300, verbose=1, validation_split=0.1, show_metrics=True)
which is from a book (Python Machine Learning by @rasbt https://github.com/rasbt/python-machine-learning-book. It's awesome, but I guess the code gets old quick!)

The new way of doing it means to add metrics=['accuracy'] to the model.compilesection, rather than themodel.fit`:

model.compile(loss='categorical_crossentropy', optimizer=sgd, metrics=['accuracy'])
I've just run into this issue, and changing the code in these places worked for me :D

@rasbt
Copy link

rasbt commented Feb 19, 2017

@JAStark The keras section? Oh yeah, that was 2015 :P. The next edition will have up-to-date tensorflow >= 1.0 code ;)

@JAStark
Copy link

JAStark commented Feb 19, 2017

@rasbt yes! Chapter 13 :)

maxpumperla added a commit that referenced this issue Mar 29, 2017
Updated readme examples for keras 2.0, solving #67 #56
@maxpumperla
Copy link
Owner

ok, it's updated now in the readme. Note that you're free to leave out additional arguments in examples as you want, hyperas is just a wrapper, not a prescription. :)

@beyhangl
Copy link

beyhangl commented May 8, 2017

@JAStark thanks

@gontthias
Copy link

@JAStark good answer,thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants