Closed TheGravityZero closed 1 year ago
Have you installed moviepy? Run pip freeze
to see your list of installed modules
Have you installed moviepy? Run
pip freeze
to see your list of installed modules
Yes. moviepy ==1.0.3.
Could you provide some example code to replicate this issue? @younik Any ideas?
I cannot reproduce the error. Are you using the experimental wrapper or the standard one?
Are you able to run from moviepy.video.io.ImageSequenceClip import ImageSequenceClip
?
Could you provide some example code to replicate this issue? @younik Any ideas?
Hello, I added code example in description.
I cannot reproduce the error. Are you using the experimental wrapper or the standard one? Are you able to run
from moviepy.video.io.ImageSequenceClip import ImageSequenceClip
?
from moviepy.video.io.ImageSequenceClip import ImageSequenceClip
this is work. I use
from stable_baselines3.common.atari_wrappers import (
ClipRewardEnv,
EpisodicLifeEnv,
FireResetEnv,
MaxAndSkipEnv,
NoopResetEnv,
)
Can you just run
import gym
env = gym.wrappers.RecordVideo(gym.make("CartPole-v1"))
env.reset()
env.close()
Can you just run
import gym env = gym.wrappers.RecordVideo(gym.make("CartPole-v1")) env.reset() env.close()
UserWarning: WARN: Overwriting existing videos at /data/course_project folder (try specifying a different video_folder for the RecordVideo wrapper if this is not desired)
Exception ignored in: <function VideoRecorder.__del__ at 0x7f7112cb7280>
LookupError: unknown encoding: ascii
Can you first update Gymnasium (pip install --upgrade "gymnasium[all]"
)
and then use it instead of Gym?
- import gym
+ import gymnasium as gym
Can you first update Gymnasium (
pip install --upgrade "gymnasium[all]"
) and then use it instead of Gym?- import gym + import gymnasium as gym
I run:
import gymnasium as gym import time env = gym.wrappers.RecordVideo(gym.make("BreakoutNoFrameskip-v4", render_mode='rgb_array_list'), video_folder='/data/course_project') env.reset() time.sleep(5) env.close()
Result: video saved, but still warnings:
WARN: Overwriting existing videos at /data/course_project folder (try specifying a different `video_folder` for the `RecordVideo` wrapper if this is not desired) WARN: No render fps was declared in the environment (env.metadata['render_fps'] is None or not defined), rendering may occur at inconsistent fps.
But I don't now how fix my code.
The first warning means you already have some previously saved videos and you are overwriting them.
The second warning is caused by the ALE's environment that doesn't specify the fps
in metadata; you can ignore it.
To fix your code, just use gymnasium instead of gym.
Can you just run
import gym env = gym.wrappers.RecordVideo(gym.make("CartPole-v1")) env.reset() env.close()
UserWarning: WARN: Overwriting existing videos at /data/course_project folder (try specifying a different video_folder for the RecordVideo wrapper if this is not desired) Exception ignored in: <function VideoRecorder.__del__ at 0x7f7112cb7280> LookupError: unknown encoding: ascii
Do you have any ideas?
The first warning mean
Thanks, it is work for the example. but my code still problem in tittle of issue. May be problems in sb3 wrappers for environment.
The first warning mean
Thanks, it is work for the example. but my code still problem in tittle of issue. May be problems in sb3 wrappers for environment.
You should post the full stack trace since the RecordVideo error is a collateral error caused in __del__
.
If this is a problem of SB3, you should open an issue there. Likely it is an incompatibility problem between the versions of Gym and SB3; you also want to check that.
Describe the bug
I am trying to use record_video to record the training of my model. I have this problem: gymnasium.error.DependencyNotInstalled: moviepy is not installed, run
pip install moviepy
UserWarning: WARN: Unable to save last video! Did you call close()?But I have installed: moviepy ==1.0.3
Code example
System info
No response
Additional context
No response
Checklist