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: VideoRecorder encoder exited with status 1 #2201

Closed
RaihanKhan1970 opened this issue Mar 21, 2021 · 4 comments
Closed

ERROR: VideoRecorder encoder exited with status 1 #2201

RaihanKhan1970 opened this issue Mar 21, 2021 · 4 comments

Comments

@RaihanKhan1970
Copy link

RaihanKhan1970 commented Mar 21, 2021

New to Open AI and would appreciate help. Everything is going smoothly but can't seem to record or play back the videos. Getting "ERROR: VideoRecorder encoder exited with status 1".

I am using Ubuntu 20

@Khoa-NT
Copy link

Khoa-NT commented Mar 30, 2021

I'm also having the same issue in my environment with python 3.8.
However, Python 3.7 on Google Colab is running normally.
Still debugging.

@RaihanKhan1970
Copy link
Author

I have a workaround. I'm training my models on my Jupyter framework and then uploading my models and recording videos on Colab.

@Khoa-NT
Copy link

Khoa-NT commented Mar 30, 2021

I fixed it. Follow this post.

  • Download gym from source (the master branch) and install with python setup.py install
  • Or use gym==0.17.3

I didn't notice Colab using gym==0.17.3

But it only works on python 3.7 with PyTorch 1.7.1
I don't know why it has this error in python 3.8 with PyTorch 1.8.1.

BrokenPipeError: [Errno 32] Broken pipe ---------------------------------------------------------------------------

BrokenPipeError Traceback (most recent call last)
in
10 action = env.action_space.sample()
11
---> 12 observation, reward, done, info = env.step(action)
13
14 if done:

/opt/conda/lib/python3.8/site-packages/gym-0.18.0-py3.8.egg/gym/wrappers/monitor.py in step(self, action)
30 self._before_step(action)
31 observation, reward, done, info = self.env.step(action)
---> 32 done = self._after_step(observation, reward, done, info)
33
34 return observation, reward, done, info

/opt/conda/lib/python3.8/site-packages/gym-0.18.0-py3.8.egg/gym/wrappers/monitor.py in _after_step(self, observation, reward, done, info)
169 self.stats_recorder.after_step(observation, reward, done, info)
170 # Record video
--> 171 self.video_recorder.capture_frame()
172
173 return done

/opt/conda/lib/python3.8/site-packages/gym-0.18.0-py3.8.egg/gym/wrappers/monitoring/video_recorder.py in capture_frame(self)
114 self._encode_ansi_frame(frame)
115 else:
--> 116 self._encode_image_frame(frame)
117
118 def close(self):

/opt/conda/lib/python3.8/site-packages/gym-0.18.0-py3.8.egg/gym/wrappers/monitoring/video_recorder.py in _encode_image_frame(self, frame)
164
165 try:
--> 166 self.encoder.capture_frame(frame)
167 except error.InvalidFrame as e:
168 logger.warn('Tried to pass invalid video frame, marking as broken: %s', e)

/opt/conda/lib/python3.8/site-packages/gym-0.18.0-py3.8.egg/gym/wrappers/monitoring/video_recorder.py in capture_frame(self, frame)
301 raise error.InvalidFrame("Your frame has data type {}, but we require uint8 (i.e. RGB values from 0-255).".format(frame.dtype))
302
--> 303 self.proc.stdin.write(frame.tobytes())
304
305 def close(self):

BrokenPipeError: [Errno 32] Broken pipe

@RaihanKhan1970
Copy link
Author

Thank you. Khoa!

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

3 participants