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

AttributeError: module 'deap.creator' has no attribute 'Particle' #679

Open
codezart opened this issue Dec 16, 2022 · 1 comment
Open

AttributeError: module 'deap.creator' has no attribute 'Particle' #679

codezart opened this issue Dec 16, 2022 · 1 comment

Comments

@codezart
Copy link

I'm following this example: https://deap.readthedocs.io/en/master/examples/pso_basic.html

when I run it, it shows be the following error

AttributeError: module 'deap.creator' has no attribute 'Particle'

When I check the codebase, I only see it defined in examples.

@fmder
Copy link
Member

fmder commented Dec 16, 2022

You need to make sure this line gets called, it is the one that will create the class on the fly.

creator.create("Particle", list, fitness=creator.FitnessMax, speed=list, smin=None, smax=None, best=None)

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

2 participants