Closed mrh335 closed 5 months ago
I am having the same issue, what was your solution to the problem? @mrh335 @ahmedfgad
For reference, my issue is solved by deleting these lines: https://github.com/ahmedfgad/GeneticAlgorithmPython/blob/0e8be9d61070df832ab89cae993e8827567d1184/pygad/pygad.py#L1683-L1685
When running version 3.1.0 and prior, the code runs to completion and returns result. When installing 3.2.0, the following error is returned after the ga_instance.run() has completed and the following code is run: solution, solution_fitness, solution_idx = ga_instance.best_solution()
`100%|██████████| 100/100 [01:44<00:00, 1.04s/it] 'numpy.ndarray' object has no attribute 'index' Traceback (most recent call last): File "C:\Users\user\AppData\Roaming\Python\Python312\site-packages\pygad\pygad.py", line 1663, in cal_pop_fitness solution_idx = self.best_solutions.index(list(sol)) ^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'numpy.ndarray' object has no attribute 'index' An exception has occurred, use %tb to see the full traceback.
Traceback (most recent call last):
File ~\AppData\Roaming\Python\Python312\site-packages\pygad\pygad.py:1663 in cal_pop_fitness solution_idx = self.best_solutions.index(list(sol))
AttributeError: 'numpy.ndarray' object has no attribute 'index'
During handling of the above exception, another exception occurred:
SystemExit: -1`