-
-
Notifications
You must be signed in to change notification settings - Fork 481
Keep Parents Issue #49
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
Labels
bug
Something isn't working
Comments
ahmedfgad
added a commit
that referenced
this issue
Jun 18, 2021
Fix a bug when keep_parents is set to a positive integer. #49
Hello, Thanks for opening this issue. It is solved now. The project is updated. PyGAD 2.15.1 will be released shortly to address the issue. Please feel free to get in touch if any issues arise. |
ahmedfgad
added a commit
that referenced
this issue
Jun 18, 2021
Fix a bug when keep_parents is set to a positive integer. #49
PyGAD 2.15.1 is released that solves the issue. Feel free to upgrade to the latest version: pip3 install --upgrade pygad Thank you! |
Thank you for your collaboration Mr.Gad. It was really helpful. I will
check upon it, and if there is another complication I will let you know.
I am currently working in the Google Collab environment. Is there any
command that you know of that will allow me to upgrade to the latest
version, similarly as the one you send me?
Thank you for your help.
El vie, 18 jun 2021 a las 0:20, Ahmed Gad ***@***.***>)
escribió:
… PyGAD 2.15.1 is released that solves the issue.
Feel free to upgrade to the latest version:
pip3 install --upgrade pygad
Thank you!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#49 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQVPESXXZVYZW273757OHATTTLQTZANCNFSM46473W6A>
.
|
@edgardohb pip install --upgrade pygad |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, first of all I would like to say you did an excellent job with the pygad project.
Secondly, I would like to address an issue I am having with the keep_parents parameter. I was running an algorithm yesterday and it was working fine, but some changes were made to the code apparently, and now everytime I assign a value to that parameter an error pops up. It is because some part of the code related to it has a variable as a tuple, but the atribute .shape is called upon, which is only supported for numpy arrays.
The error is the following:
AttributeError: 'tuple' object has no attribute 'shape'
And it happens on the line 1202 of the pygad.py code.
1200 elif (self.keep_parents > 0): 1201 parents_to_keep = self.steady_state_selection(self.last_generation_fitness, num_parents=self.keep_parents) -> 1202 self.population[0:parents_to_keep.shape[0], :] = parents_to_keep 1203 self.population[parents_to_keep.shape[0]:, :] = self.last_generation_offspring_mutation 1204
Is there a different way to implement this parameter now? Or if there is not is there a posibility that you would mind fixing the code?
Thanks for your time and work on the pygad project.
The text was updated successfully, but these errors were encountered: