-
-
Notifications
You must be signed in to change notification settings - Fork 50
-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Problem with buckshot and lattice when using ray #130
Comments
@yolking: a few comments... (1) diffev2, and most solvers, need tuning. Which means, they can work poorly until you play with the settings, termination conditions, constraints, and so on until it works. (2) It'd be helpful for you to post your traceback. (3) You may want to try to use a I believe that the issue may be that I should add that I haven't tried using |
Thank you for your comments, @mmckerns. I agree, I haven't looked close enough at About Here is traceback from 2020-10-08 22:19:42,566 ERROR worker.py:1018 -- Possible unhandled error from worker: ray::f() (pid=29764, ip=192.168.31.253)
File "python\ray\_raylet.pyx", line 484, in ray._raylet.execute_task
File "<ipython-input-60-7ab75046726e>", line 53, in f
File "C:\Users\user\Anaconda3\envs\env\lib\site-packages\mystic\ensemble.py", line 241, in lattice
ExtraArgs=args,callback=callback)
File "C:\Users\user\Anaconda3\envs\env\lib\site-packages\mystic\abstract_solver.py", line 937, in Solve
self._Solve(cost, ExtraArgs, **settings)
File "C:\Users\user\Anaconda3\envs\env\lib\site-packages\mystic\abstract_ensemble_solver.py", line 653, in _Solve
results = list(self._map(_solve, op, iv, vb, cb, **self._mapconfig))
File "C:\Users\user\Anaconda3\envs\env\lib\site-packages\mystic\python_map.py", line 66, in python_map
result = list(map(func, *arglist)) # see pathos.pyina.ez_map
File "C:\Users\user\Anaconda3\envs\env\lib\site-packages\mystic\abstract_ensemble_solver.py", line 638, in _solve
solver.Solve(disp=disp,callback=callback)
File "C:\Users\user\Anaconda3\envs\env\lib\site-packages\mystic\scipy_optimize.py", line 360, in Solve
ExtraArgs, **kwds)
File "C:\Users\user\Anaconda3\envs\env\lib\site-packages\mystic\abstract_solver.py", line 937, in Solve
self._Solve(cost, ExtraArgs, **settings)
File "C:\Users\user\Anaconda3\envs\env\lib\site-packages\mystic\abstract_solver.py", line 880, in _Solve
stop = self.Step(**settings) #XXX: remove need to pass settings?
File "C:\Users\user\Anaconda3\envs\env\lib\site-packages\mystic\abstract_solver.py", line 853, in Step
self._Step(**kwds) #FIXME: not all kwds are given in __doc__
File "C:\Users\user\Anaconda3\envs\env\lib\site-packages\mystic\scipy_optimize.py", line 233, in _Step
fsim[0] = cost(x0)
File "C:\Users\user\Anaconda3\envs\env\lib\site-packages\mystic\tools.py", line 353, in function_wrapper
return outer_function(inner_function(_x))
File "C:\Users\user\Anaconda3\envs\env\lib\site-packages\mystic\tools.py", line 364, in function_wrapper
return cost_function(_x) + penalty_function(_x)
File "C:\Users\user\Anaconda3\envs\env\lib\site-packages\mystic\tools.py", line 402, in function_wrapper
return target_function(x)
File "C:\Users\user\Anaconda3\envs\env\lib\site-packages\mystic\tools.py", line 375, in function_wrapper
fval = the_function(x, *extra_args)
File "<ipython-input-60-7ab75046726e>", line 30, in opt_func
NameError: name 'MyClass' is not defined |
Hi @mmckerns, thank you for such powerful project!
I am trying to use
mystic
for optimization of multiple functions in parallel on Windows. They are dependent on other functions in file and in helper .py files. I triedpathos
way at first, but couldn't figure out how to import all such functions (on which optimized functions depend) at once to Pool. So i decided to try recently portedray
library on Windows withmystic
. It works perfectly fine if I usediffev2
, but it looks likediffev2
is quite bad at global optimization for me, so I am leaning towardslattice
orbuckshot
. They work fine without parallelization. Unfortunately, withray
if I change solver to one of those I start getting error messages about imported classes from helper .py files and libraries such asNameError: MyClass is not defined
andNameError: name 'pandas' is not defined
.Simplified version of my code looks like this:
Since
diffev2
works fine, I am guessing there is something different about how pseudo-global methods import stuff. I tried importing MyClass insideopt_func
since there Error happens, but I receive new errorImportError: __import__ not found
. Same happens with full definitions of these optimizers. Can I somehow make these optimizers work too?The text was updated successfully, but these errors were encountered: