Recording videos of custom gym environments

Hi, I am try to use VecVideoRecorder to log videos of my custom environment. The observation come from a camera, though I don’t think that is the issue. The error is:

AttributeError(“‘VideoRecorder’ object has no attribute ‘path’”)

I’m not directly setting nor accessing an attribute ‘path’ so I’m having identifying where this is coming from. My code looks like this:

def make_env():
    env = DummyVecEnv([lambda:    Monitor(ReacherFiveJointsImageSpace(random_start=wandb.config.random_start,
                                                        log_state_actions=True,
                                                        shape_reward=wandb.config.shape_reward,
                                                        file_name_prefix=wandb.config.rl_name,
                                                        env_type=wandb.config.env_type,
                                                        seed=(wandb.config.seed+wandb.config.run)),
                                       log_dir)])
    env = VecNormalize(env, norm_obs=True, norm_reward=True, clip_obs=5.)
    env = VecVideoRecorder(env, video_folder=log_dir,
                           record_video_trigger=lambda x: x % 100 == 0, video_length=10)  # record videos
    stats_path = os.path.join(log_dir,
                              "run" + str(wandb.config.run) + "_vec_normalize_" + run.id + ".pkl")
    env.save(stats_path)
    return env

Can anyone point me in the right direction?

Thanks!

Hi @cbellinger , this doesn’t appear to be directly tied to W&B. Can you please revisit source code for the videorecorder to identify if your setup is correct. Thanks

Hi @cbellinger , since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!