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

Error after python main.py --env-name "PongNoFrameskip-v4" #271

Open
FulChou opened this issue Apr 8, 2021 · 3 comments
Open

Error after python main.py --env-name "PongNoFrameskip-v4" #271

FulChou opened this issue Apr 8, 2021 · 3 comments

Comments

@FulChou
Copy link

FulChou commented Apr 8, 2021

hello,
i get this error, when i run code "python main.py --env-name "PongNoFrameskip-v4"
i don't know what happed, my env is:
python3.6.3
Package Version


atari-py 0.2.6
cached-property 1.5.2
cloudpickle 1.6.0
cycler 0.10.0
dataclasses 0.8
future 0.18.2
gym 0.18.0
h5py 3.1.0
kiwisolver 1.3.1
matplotlib 3.3.4
numpy 1.19.5
pandas 1.1.5
Pillow 7.2.0
pip 21.0.1
pybullet 3.1.2
pyglet 1.5.0
pyparsing 2.4.7
python-dateutil 2.8.1
pytz 2021.1
scipy 1.5.4
setuptools 28.8.0
six 1.15.0
stable-baselines3 1.0
torch 1.8.1
typing-extensions 3.7.4.3

Thank you for your help!

error:
Process ForkServerProcess-2:
Process ForkServerProcess-6:
Traceback (most recent call last):
Traceback (most recent call last):
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/stable_baselines3/common/vec_env/subproc_vec_env.py", line 38, in _worker
observation = env.reset()
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 264, in reset
observation = self.env.reset(**kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/stable_baselines3/common/vec_env/subproc_vec_env.py", line 38, in _worker
observation = env.reset()
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 264, in reset
observation = self.env.reset(**kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 277, in reset
return self.env.reset(**kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 265, in reset
return self.observation(observation)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/stable_baselines3/common/atari_wrappers.py", line 202, in observation
frame = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY)
AttributeError: 'NoneType' object has no attribute 'cvtColor'
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 277, in reset
return self.env.reset(**kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 265, in reset
return self.observation(observation)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/stable_baselines3/common/atari_wrappers.py", line 202, in observation
frame = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY)
AttributeError: 'NoneType' object has no attribute 'cvtColor'
Process ForkServerProcess-5:
Traceback (most recent call last):
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/stable_baselines3/common/vec_env/subproc_vec_env.py", line 38, in _worker
observation = env.reset()
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 264, in reset
observation = self.env.reset(**kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 277, in reset
return self.env.reset(**kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 265, in reset
return self.observation(observation)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/stable_baselines3/common/atari_wrappers.py", line 202, in observation
frame = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY)
AttributeError: 'NoneType' object has no attribute 'cvtColor'
Process ForkServerProcess-1:
Traceback (most recent call last):
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/stable_baselines3/common/vec_env/subproc_vec_env.py", line 38, in _worker
observation = env.reset()
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 264, in reset
observation = self.env.reset(**kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 277, in reset
return self.env.reset(**kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 265, in reset
return self.observation(observation)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/stable_baselines3/common/atari_wrappers.py", line 202, in observation
frame = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY)
AttributeError: 'NoneType' object has no attribute 'cvtColor'
Process ForkServerProcess-3:
Traceback (most recent call last):
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/stable_baselines3/common/vec_env/subproc_vec_env.py", line 38, in _worker
observation = env.reset()
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 264, in reset
observation = self.env.reset(**kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 277, in reset
return self.env.reset(**kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 265, in reset
return self.observation(observation)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/stable_baselines3/common/atari_wrappers.py", line 202, in observation
frame = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY)
AttributeError: 'NoneType' object has no attribute 'cvtColor'
Process ForkServerProcess-7:
Traceback (most recent call last):
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/stable_baselines3/common/vec_env/subproc_vec_env.py", line 38, in _worker
observation = env.reset()
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 264, in reset
observation = self.env.reset(**kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 277, in reset
return self.env.reset(**kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 265, in reset
return self.observation(observation)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/stable_baselines3/common/atari_wrappers.py", line 202, in observation
frame = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY)
AttributeError: 'NoneType' object has no attribute 'cvtColor'
Process ForkServerProcess-4:
Traceback (most recent call last):
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/stable_baselines3/common/vec_env/subproc_vec_env.py", line 38, in _worker
observation = env.reset()
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 264, in reset
observation = self.env.reset(**kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 277, in reset
return self.env.reset(**kwargs)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/gym/core.py", line 265, in reset
return self.observation(observation)
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/stable_baselines3/common/atari_wrappers.py", line 202, in observation
frame = cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY)
AttributeError: 'NoneType' object has no attribute 'cvtColor'
Traceback (most recent call last):
File "main.py", line 198, in
main()
File "main.py", line 96, in main
obs = envs.reset()
File "/Users/vincent/Downloads/pytorch-a2c-ppo-acktr-gail-master/a2c_ppo_acktr/envs.py", line 250, in reset
obs = self.venv.reset()
File "/Users/vincent/Downloads/pytorch-a2c-ppo-acktr-gail-master/a2c_ppo_acktr/envs.py", line 175, in reset
obs = self.venv.reset()
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/stable_baselines3/common/vec_env/subproc_vec_env.py", line 133, in reset
obs = [remote.recv() for remote in self.remotes]
File "/Users/vincent/.pyenv/versions/a2c_3.6.3/lib/python3.6/site-packages/stable_baselines3/common/vec_env/subproc_vec_env.py", line 133, in
obs = [remote.recv() for remote in self.remotes]
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/connection.py", line 250, in recv
buf = self._recv_bytes()
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/connection.py", line 407, in _recv_bytes
buf = self._recv(4)
File "/Users/vincent/.pyenv/versions/3.6.3/lib/python3.6/multiprocessing/connection.py", line 383, in _recv
raise EOFError
EOFError

@NJJ-UA
Copy link

NJJ-UA commented May 18, 2021

try:
pip3 install opencv-python

@igbp
Copy link

igbp commented May 19, 2021

Hi,
@CSU-FulChou did you get a work around?

I'm running into the exact same issue:

Process ForkProcess-8:
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/home/giovani/baselines/baselines/common/vec_env/shmem_vec_env.py", line 123, in _subproc_worker
cmd, data = pipe.recv()
File "/usr/lib/python3.6/multiprocessing/connection.py", line 250, in recv
buf = self._recv_bytes()
File "/usr/lib/python3.6/multiprocessing/connection.py", line 407, in _recv_bytes
buf = self._recv(4)
File "/usr/lib/python3.6/multiprocessing/connection.py", line 383, in _recv
raise EOFError
EOFError

Repeats for 8 forkprocesses.
Tried the opencv-python install and did not work.

@BigBearBlacken
Copy link

try: pip3 install opencv-python

nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants