Skip to content

Problems with multithreading and generation step #150

Open
@BenoitMiquey

Description

@BenoitMiquey

Hi,

I realy appreciate your works on PyGAD!

I'm using it to make some chaotic learning with thousands of model, and a greedy fitness function. the parallelization is realy efficient in my case.

I have found some problems with multithreading using keras models.

To reproduce the problem, i use this regression sample : https://pygad.readthedocs.io/en/latest/README_pygad_kerasga_ReadTheDocs.html#example-1-regression-example

I only reduce the num_generations to 100.

Steps to reproduce :

I run a few times the sample,
image
image
image
image

  • then, i enable the parallel processing on 8 threads :

image

  • then, run again a few times :

image
image
image
image

  • sometimes, i see in logs a fitness lower than the n-1 generation, example :

image

  • I printed all solutions used in each epoch, and i saw thats solutions are most of time the same, so the parallel_processing seems to break the generation of the next population in the most of cases.

Thanks!

EDIT :
In addition i tried to reproduce the same problem with this classification problem sample ,
Adding the multiprocessing support cause the same problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions