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

Runner multi proc in 0.8.0 #66

Closed
Tezirg opened this issue May 5, 2020 · 1 comment
Closed

Runner multi proc in 0.8.0 #66

Tezirg opened this issue May 5, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@Tezirg
Copy link
Contributor

Tezirg commented May 5, 2020

grid2op.Runner has broken multi processor execution in 0.8.0:

from grid2op import make
from grid2op.Runner import Runner
from grid2op.Agent import DoNothingAgent

env = make("rte_case14_realistic", test=True)
runner_params = env.get_params_for_runner()
runner = Runner(**runner_params, agentClass=DoNothingAgent)
res = runner.run(path_save=logs_path,
                 nb_episode=nb_episode, nb_process=4,
                 max_iter=-1, pbar=True)

Multi process running fails with the following:

python3.6/site-packages/grid2op/Runner/Runner.py", line 814, in run_parrallel
    [(self, pn, i, path_save) for i, pn in enumerate(process_ids)])
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 274, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get
    raise self._value
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 424, in _handle_tasks
    put(task)
  File "/usr/lib/python3.6/multiprocessing/connection.py", line 206, in send
    self._send_bytes(_ForkingPickler.dumps(obj))
  File "/usr/lib/python3.6/multiprocessing/reduction.py", line 51, in dumps
    cls(buf, protocol).dump(obj)
AttributeError: Can't pickle local object 'GridObjects.init_grid.<locals>.res'
@Tezirg Tezirg added the bug Something isn't working label May 5, 2020
@BDonnot BDonnot mentioned this issue May 6, 2020
@BDonnot
Copy link
Collaborator

BDonnot commented May 6, 2020

Fixed in version v0.8.1

@BDonnot BDonnot closed this as completed May 6, 2020
BDonnot added a commit that referenced this issue Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants