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

pyOpt TypeError: 'bool' object is not iterable #6

Open
kiwiwan opened this issue Dec 13, 2018 · 1 comment
Open

pyOpt TypeError: 'bool' object is not iterable #6

kiwiwan opened this issue Dec 13, 2018 · 1 comment

Comments

@kiwiwan
Copy link

kiwiwan commented Dec 13, 2018

@kjyv ,could you help me?When i run parallel_optimize_kuka_lwr4.sh,i got the following error.I'm almost get the solution,because it have runed 250 iterations(153 iterations for global optimizer,the rest for local).What's more, i run optimize_kuka_lwr4.sh could get well solution,not error.
I use ubuntu 16.06 and python2.7,pyOpt from your readme.

capi_return is NULL
Call-back cb_slgrad_in_slsqp__user__routines failed.
Traceback (most recent call last):
File "./trajectory.py", line 91, in
main()
File "./trajectory.py", line 68, in main
trajectory = trajectoryOptimizer.optimizeTrajectory()
File "/home/kiwi/soft/learn/IDIM/FloBaRoID/excitation/trajectoryOptimizer.py", line 394, in optimizeTrajectory
sol_vec = self.runOptimizer(opt_prob)
File "/home/kiwi/soft/learn/IDIM/FloBaRoID/excitation/optimizer.py", line 573, in runOptimizer
opt2(opt_prob, sens_step=0.1, sens_mode='pgc', store_hst=False)
File "/home/kiwi/anaconda2/envs/FloBaRoID/lib/python2.7/site-packages/pyOpt/pyOpt_optimizer.py", line 146, in call
return self.solve(opt_problem, *args, **kwargs)
File "/home/kiwi/anaconda2/envs/FloBaRoID/lib/python2.7/site-packages/pyOpt/pySLSQP/pySLSQP.py", line 398, in solve
slfunc, slgrad)
File "/home/kiwi/anaconda2/envs/FloBaRoID/lib/python2.7/site-packages/pyOpt/pySLSQP/pySLSQP.py", line 292, in slgrad
kwargs)
File "/home/kiwi/anaconda2/envs/FloBaRoID/lib/python2.7/site-packages/pyOpt/pyOpt_gradient.py", line 288, in getGrad
[df, dg] = self.Bcast([df, dg], root=0)
TypeError: 'bool' object is not iterable

@kjyv
Copy link
Owner

kjyv commented Dec 14, 2018

If you're sure that you used my fork of pyOpt it might be a bug that I haven't encountered yet. You could print out the relevant variables from pyOpt_gradient.py and check why there is a bool value where it shouldn't. Also the whole mpi code in pyOpt could be much improved, so you might first try to run it with a single process and see if that works ok.

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