ikostrikov/pytorch-a2c-ppo-acktr-gail

Running main.py in PyCharm, results in BrokenPipeError or EOFError

Opened this issue · 0 comments

When I run

python3 main.py

It works perfectly fine on macOS Big Sur terminal, however when I run main.py from PyCharm, I know this might not make a lot of sense, I get one of the two errors below, and I'm using the same python interpreter, so it's something else.

Error 1

objc[1935]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[1935]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
objc[1934]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[1934]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
objc[1937]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[1937]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
objc[1936]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[1936]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
objc[1938]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[1938]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
Traceback (most recent call last):
  File "/Users/emadboctor/Desktop/pytorch-a2c-ppo-acktr-gail/main.py", line 198, in <module>
    main()
  File "/Users/emadboctor/Desktop/pytorch-a2c-ppo-acktr-gail/main.py", line 41, in main
    envs = make_vec_envs(args.env_name, args.seed, args.num_processes,
  File "/Users/emadboctor/Desktop/pytorch-a2c-ppo-acktr-gail/a2c_ppo_acktr/envs.py", line 93, in make_vec_envs
    envs = SubprocVecEnv(envs)
  File "/usr/local/lib/python3.8/site-packages/stable_baselines3/common/vec_env/subproc_vec_env.py", line 105, in __init__
    self.remotes[0].send(("get_spaces", None))
  File "/usr/local/Cellar/python@3.8/3.8.7/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/connection.py", line 206, in send
    self._send_bytes(_ForkingPickler.dumps(obj))
  File "/usr/local/Cellar/python@3.8/3.8.7/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/connection.py", line 411, in _send_bytes
    self._send(header + buf)
  File "/usr/local/Cellar/python@3.8/3.8.7/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/connection.py", line 368, in _send
    n = write(self._handle, buf)
BrokenPipeError: [Errno 32] Broken pipe

Error2

objc[2129]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[2129]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
objc[2127]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[2127]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
Traceback (most recent call last):
  File "/Users/emadboctor/Desktop/code/drl-algos/ptan_scratch/pytorch-a2c-ppo-acktr-gail/main.py", line 260, in <module>
    main()
  File "/Users/emadboctor/Desktop/code/drl-algos/ptan_scratch/pytorch-a2c-ppo-acktr-gail/main.py", line 40, in main
    envs = make_vec_envs(
  File "/Users/emadboctor/Desktop/code/drl-algos/ptan_scratch/pytorch-a2c-ppo-acktr-gail/a2c_ppo_acktr/envs.py", line 103, in make_vec_envs
    envs = SubprocVecEnv(envs)
  File "/usr/local/lib/python3.8/site-packages/stable_baselines3/common/vec_env/subproc_vec_env.py", line 106, in __init__
    observation_space, action_space = self.remotes[0].recv()
  File "/usr/local/Cellar/python@3.8/3.8.7/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/connection.py", line 250, in recv
    buf = self._recv_bytes()
  File "/usr/local/Cellar/python@3.8/3.8.7/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/connection.py", line 414, in _recv_bytes
    buf = self._recv(4)
  File "/usr/local/Cellar/python@3.8/3.8.7/Frameworks/Python.framework/Versions/3.8/lib/python3.8/multiprocessing/connection.py", line 383, in _recv
    raise EOFError
EOFError
objc[2128]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
objc[2128]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.