Open MakisKans opened 4 years ago
I was facing similar issues, but I solved it by removing verbose. Try removing verbose =1 , from model = PPO2(CnnPolicy, env, verbose=1).
still, struggling in this issues, does anyone help me out?
Same problem. Does this have an answer now?
Same
Facing the same problem. Is anyone having a solution to this ?
/root/miniconda3/lib/python3.7/multiprocessing/connection.py:379: ConnectionResetError
----------------------------------------------------------------------------- Captured stderr call ------------------------------------------------------------------------------
Process SpawnProcess-2:
Traceback (most recent call last):
File "/root/miniconda3/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
self.run()
File "/root/miniconda3/lib/python3.7/multiprocessing/process.py", line 99, in run
self._target(*self._args, **self._kwargs)
File "/root/virtualenv/venv/baselines/baselines/common/vec_env/subproc_vec_env.py", line 15, in worker
envs = [env_fn_wrapper() for env_fn_wrapper in env_fn_wrappers.x]
File "/root/virtualenv/venv/baselines/baselines/common/vec_env/subproc_vec_env.py", line 15, in <listcomp>
envs = [env_fn_wrapper() for env_fn_wrapper in env_fn_wrappers.x]
File "/root/virtualenv/venv/baselines/baselines/common/tests/test_env_after_learn.py", line 15, in make_env
env = gym.make('CartPole-v1' if algo == 'acktr' else 'PongNoFrameskip-v4')
File "/root/miniconda3/lib/python3.7/site-packages/gym/envs/registration.py", line 156, in make
return registry.make(id, **kwargs)
File "/root/miniconda3/lib/python3.7/site-packages/gym/envs/registration.py", line 101, in make
env = spec.make(**kwargs)
File "/root/miniconda3/lib/python3.7/site-packages/gym/envs/registration.py", line 73, in make
env = cls(**_kwargs)
File "/root/miniconda3/lib/python3.7/site-packages/gym/envs/atari/atari_env.py", line 49, in __init__
self.game_path = atari_py.get_game_path(game)
File "/root/miniconda3/lib/python3.7/site-packages/atari_py/games.py", line 20, in get_game_path
raise Exception('ROM is missing for %s, see https://github.com/openai/atari-py#roms for instructions' % (game_name,))
Exception: ROM is missing for pong, see https://github.com/openai/atari-py#roms for instructions
__________________________________________________________________________ test_env_after_learn[deepq] __________________________________________________________________________
algo = 'deepq'
@pytest.mark.parametrize('algo', algos)
def test_env_after_learn(algo):
def make_env():
# acktr requires too much RAM, fails on travis
env = gym.make('CartPole-v1' if algo == 'acktr' else 'PongNoFrameskip-v4')
return env
make_session(make_default=True, graph=tf.Graph())
> env = SubprocVecEnv([make_env])
baselines/common/tests/test_env_after_learn.py:19:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
baselines/common/vec_env/subproc_vec_env.py:71: in __init__
observation_space, action_space, self.spec = self.remotes[0].recv().x
/root/miniconda3/lib/python3.7/multiprocessing/connection.py:250: in recv
buf = self._recv_bytes()
/root/miniconda3/lib/python3.7/multiprocessing/connection.py:407: in _recv_bytes
buf = self._recv(4)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <multiprocessing.connection.Connection object at 0x7f4be43769b0>, size = 4, read = <built-in function read>
def _recv(self, size, read=_read):
buf = io.BytesIO()
handle = self._handle
remaining = size
while remaining > 0:
> chunk = read(handle, remaining)
E ConnectionResetError: [Errno 104] Connection reset by peer
/root/miniconda3/lib/python3.7/multiprocessing/connection.py:379: ConnectionResetError
----------------------------------------------------------------------------- Captured stderr call
I noticed this error:
raise Exception('ROM is missing for %s, see https://github.com/openai/atari-py#roms for instructions' % (game_name,))
When I solved this error, ConnectionResetError: [Errno 104] Connection reset by peer
disappeared.But there is one error left
===================================================== 46 failed, 49 passed, 31 skipped, 1111 warnings in 110.05s (0:01:50) ======================================================
The error becomes:
====================================================== 1 failed, 94 passed, 31 skipped, 6368 warnings in 269.86s (0:04:29) ======================================================
baselines/common/tests/test_doc_examples.py:20: in <lambda>
venv = DummyVecEnv([lambda: cmd_util.make_mujoco_env('Reacher-v2', seed=0)])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
env_id = 'Reacher-v2', seed = 0, reward_scale = 1.0
def make_mujoco_env(env_id, seed, reward_scale=1.0):
"""
Create a wrapped, monitored gym.Env for MuJoCo.
"""
> rank = MPI.COMM_WORLD.Get_rank()
E AttributeError: 'NoneType' object has no attribute 'COMM_WORLD'
baselines/common/cmd_util.py:112: AttributeError
My environment(for your information):
┌──(root💀agi)-[~]
└─# uname -a
Linux agi 5.14.0-kali4-amd64 #1 SMP Debian 5.14.16-1kali1 (2021-11-05) x86_64 GNU/Linux
┌──(venv)─(root💀agi)-[~/virtualenv/venv/baselines]
└─# pip list 130 ⨯
Package Version Location
---------------------- ---------- -------------------------------
absl-py 1.0.0
asn1crypto 0.24.0
astor 0.8.1
atari-py 0.2.9
attrs 21.2.0
baselines 0.1.6 /root/virtualenv/venv/baselines
box2d-py 2.3.8
cached-property 1.5.2
certifi 2021.10.8
cffi 1.12.2
chardet 3.0.4
click 8.0.3
cloudpickle 1.2.2
conda 4.10.3
conda-package-handling 1.7.3
cryptography 2.6.1
cycler 0.11.0
Cython 0.29.26
filelock 3.4.0
fonttools 4.28.5
future 0.18.2
gast 0.5.3
glfw 2.5.0
google-pasta 0.2.0
grpcio 1.43.0
gym 0.15.7
h5py 3.6.0
idna 2.8
imageio 2.13.4
importlib-metadata 4.10.0
iniconfig 1.1.1
joblib 1.1.0
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.2
kiwisolver 1.3.2
lockfile 0.12.2
Markdown 3.3.6
matplotlib 3.5.1
mujoco-py 1.50.1.68
numpy 1.21.5
opencv-python 4.5.4.60
packaging 21.3
pandas 1.3.5
Pillow 8.4.0
pip 19.0.3
pluggy 1.0.0
protobuf 3.19.1
py 1.11.0
pycosat 0.6.3
pycparser 2.19
pyglet 1.5.0
pyOpenSSL 19.0.0
pyparsing 3.0.6
PySocks 1.6.8
pytest 6.2.5
python-dateutil 2.8.2
pytz 2021.3
requests 2.21.0
ruamel-yaml 0.15.46
scipy 1.7.3
setuptools 41.0.0
six 1.12.0
tensorboard 1.14.0
tensorflow 1.14.0
tensorflow-estimator 1.14.0
termcolor 1.1.0
toml 0.10.2
tqdm 4.62.3
typing-extensions 4.0.1
urllib3 1.24.1
Werkzeug 2.0.2
wheel 0.33.1
wrapt 1.13.3
youtube-dl 2021.12.17
zipp 3.6.0
same error...
same error
Same issue. When i try to use SubProcVecEnv on colab
same issue and i know it's related to my customed env bc change to another env the error won't occur
for the " 'NoneType' object has no attribute 'COMM_WORLD' " error, solve it using 'pip install mpi4py==4.0.1'. Just a lack of dependency module error.
I'm trying to run the following code and test PPO with Sonic the hedghehog, running it in parralel with SubProcVecEnv Unfortunately I run in the following error:
This is the code:
And the my_wrappers module