-
Notifications
You must be signed in to change notification settings - Fork 8.7k

Description
If you are submitting a bug report, please fill in the following details and use the tag [bug].
Describe the bug
When trying to save a video of the Hopper-v2 environment, it stops after a couple (14) of steps with the error:
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
I am able to render the environment perfectly (when not capturing) , and the code does work for the Cartpole environment.
In the hopper case, the first 14 frames are captured and saved in the mp4 file though, but I do not understand why the process finishes mid-episode.
Code example
import os
from gym.wrappers.monitoring.video_recorder import VideoRecorder
path_project = os.path.abspath(os.path.join(__file__, ".."))
path_of_video_with_name = os.path.join(path_project, "videotest.mp4")
env = gym.make('Hopper-v2') # for making environment
state = env.reset()
video_recorder = None
video_recorder = VideoRecorder(env, path_of_video_with_name, enabled=True)
for _ in range(1000):
env.render()
video_recorder.capture_frame()
env.step(env.action_space.sample()) # take a random action
print("Saved video.")
video_recorder.close()
video_recorder.enabled = False
env.close()
System Info
I am using Linux 20.0.4 (Ubuntu), Gym version 0.21.0 using pip install gym, python version 3.7.6.
Additional context
Add any other context about the problem here.
Checklist
- I have checked that there is no similar issue in the repo (required)