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
RuntimeError: Unable to load multiprocessing context.
Please ensure that you properly initialize your program by wrapping your main()
call:
def main(argv):
...
if __name__ == '__main__':
tf_agents.system.multiprocessing.handle_main(main, extra_state_savers=...)
or, if using absl.app:
if __name__ == '__main__':
tf_agents.system.multiprocessing.handle_main(
functools.partial(absl.app.run, main), extra_state_savers=...)
For unit tests, this also means wrapping your test.main using handle_test_main:
if __name__ == '__main__':
tf_agents.system.multiprocessing.handle_test_main(
tf.test.main, extra_state_savers=...)
or
if __name__ == '__main__':
tf_agents.system.multiprocessing.handle_test_main(
tf_agents.utils.test_utils.main, extra_state_savers=...)
If you are in interactive mode (e.g. python console, ipython, jupyter notebook)
use:
tf_agents.system.multiprocessing.enable_interactive_mode(
extra_state_savers=...)
For more details on state savers, see the docstrings for
`tf_agents.multiprocessing.handle_*` and:
https://pythonspeed.com/articles/python-multiprocessing/
In call to configurable 'ParallelPyEnvironment' (<class 'tf_agents.environments.parallel_py_environment.ParallelPyEnvironment'>)
I do think my PyEnvironment does not have any issues as the validation was successful. However, my initialization might be incorrect. Kindly help me with this.
The text was updated successfully, but these errors were encountered:
This is the code I am implementing: -
Along with other dependencies;
from tf_agents.environments import ParallelPyEnvironment
The RuntimeError I get is
I do think my PyEnvironment does not have any issues as the validation was successful. However, my initialization might be incorrect. Kindly help me with this.
The text was updated successfully, but these errors were encountered: