FloBaRoID icon indicating copy to clipboard operation
FloBaRoID copied to clipboard

pyOpt TypeError: 'bool' object is not iterable

Open kiwiwan opened this issue 6 years ago • 1 comments

@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

kiwiwan avatar Dec 13 '18 12:12 kiwiwan

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.

kjyv avatar Dec 14 '18 13:12 kjyv