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

keras.ga - How can I disable printing for every step? #148

Closed
vader-coder opened this issue Dec 3, 2022 · 1 comment
Closed

keras.ga - How can I disable printing for every step? #148

vader-coder opened this issue Dec 3, 2022 · 1 comment
Labels
question Further information is requested

Comments

@vader-coder
Copy link

I am using the kerasga module and it keeps printing for every step like so:

1/1 [==============================] - 0s 7ms/step
1/1 [==============================] - 0s 8ms/step
1/1 [==============================] - 0s 7ms/step

All the google answers that I can find tell me to put verbose=0 when I call keras' model.predict.
However, I am not calling model.predict, I am calling pygad.kerasga.predict(model=model, solution=solution, data=state)
and this function doesn't support a verbose flag. What can I do to stop it from printing on every step?
My pygad version is 2.18.1 and my python version is 3.10.6.

@BenoitMiquey
Copy link

BenoitMiquey commented Dec 13, 2022

Hi, i had the same problem,

to fix this, edit the kerasga.py file, line 44 change
predictions = model.predict(data)

to :

predictions = model.predict(data, verbose="0")

@ahmedfgad ahmedfgad added the question Further information is requested label Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants