You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setup ParametrizedCMA as the optimizer with fcmaes=True
Run optimization (full or partial)
Pickling error when trying optimizer.dump
Observed Results
Mysterious error:
optimizer.dump("test.pkl")
File "D:\Atom\VENVs\torch_env\Lib\site-packages\nevergrad\optimization\base.py", line 242, in dump
pickle.dump(self, f)
File "C:\Users\nate\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\heap.py", line 54, in __getstate__
assert_spawning(self)
File "C:\Users\nate\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\context.py", line 373, in assert_spawning
raise RuntimeError(
RuntimeError: Arena objects should only be shared between processes through inheritance
Expected Results
The optimizer is saved (pickled) without error.
Relevant Code
import nevergrad as ng
import numpy as np
def simple_func(params):
return sum(params)
ng_params = ng.p.Array(init=np.random.rand(10) - 0.5)
opt = ng.families.ParametrizedCMA(
elitist=True, popsize=100, diagonal=False, fcmaes=True, random_init=True
)
optimizer = opt(
parametrization=ng_params,
budget=100,
num_workers=1,
)
optimizer.enable_pickling() # makes no difference
rec = optimizer.minimize(simple_func).value
print(rec)
optimizer.dump("test.pkl")
The text was updated successfully, but these errors were encountered:
Steps to reproduce
(see code example below)
fcmaes=True
Observed Results
Mysterious error:
Expected Results
The optimizer is saved (pickled) without error.
Relevant Code
The text was updated successfully, but these errors were encountered: