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

unexpected keyword argument 'print_step' #317

Closed
olixu opened this issue Mar 6, 2019 · 8 comments
Closed

unexpected keyword argument 'print_step' #317

olixu opened this issue Mar 6, 2019 · 8 comments
Assignees
Labels
documentation Documentation improvements or fixes

Comments

@olixu
Copy link

olixu commented Mar 6, 2019

Describe the bug

when i play your demo: /example/train_neural_network. it shows:

2019-03-06 14:50:56,821 - pyswarms.single.global_best - INFO - Optimize for 1000 iters with {'c1': 0.5, 'c2': 0.3, 'w': 0.9}
pyswarms.single.global_best:   0%|          |0/1000
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<timed exec> in <module>

~/Envs/huodian/lib/python3.7/site-packages/pyswarms/single/global_best.py in optimize(self, objective_func, iters, fast, **kwargs)
    181             # Compute cost for current position and personal best
    182             # fmt: off
--> 183             self.swarm.current_cost = objective_func(self.swarm.position, **kwargs)
    184             self.swarm.pbest_pos, self.swarm.pbest_cost = compute_pbest(self.swarm)
    185             # Set best_cost_yet_found for ftol

TypeError: f() got an unexpected keyword argument 'print_step'

Environment (please complete the following information):

  • OS: [Linux]
  • Version [manjaro 18]
  • PySwarms Version [v1.0.2]
  • Python Version [3.7.2]

Additional context
None

Thank you!

@stevenbw
Copy link
Collaborator

stevenbw commented Mar 6, 2019

Hi @olixu , welcome to PySwarms!

Thank you for raising this, we are already aware of the issue (see #264 ) and are currently working on updating them. Perhaps you could work on one, if you are interested?

@stevenbw stevenbw self-assigned this Mar 6, 2019
@stevenbw stevenbw added the documentation Documentation improvements or fixes label Mar 6, 2019
@lcyuanjiang
Copy link

obviously, the optimizer function doesn't have the 'print_step' and 'verbos' interface

@ljvmiranda921
Copy link
Owner

Hi @lcyuanjiang , would you like to contribute in updating the documentation?

@ArtificialZeng
Copy link

the same situation.

@ArtificialZeng
Copy link

Did you solved this???

@lcyuanjiang
Copy link

optimize(fx.sphere,inters=20000) ,get rid of the"print_step="

@lcyuanjiang
Copy link

lcyuanjiang commented Apr 10, 2019 via email

@ljvmiranda921
Copy link
Owner

Hopefully this is already solved. Closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation improvements or fixes
Projects
None yet
Development

No branches or pull requests

5 participants