You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the highway_env environment, I have designed the following:
def default_config(cls) -> dict:
cfg = super().default_config()
cfg.update({
"simulation_frequency": 5,
"policy_frequency": 5,
"lanes_count": 3,
"vehicles_count": 30,
"duration": 30, # [s]
"ego_spacing": 1.5,
})
return cfg
Here, the duration is set to 30 seconds. However, when validating the trained PPO policy, the recorded result consistently lasts only 15 seconds, despite no collisions that would terminate the simulation. The following is the testing and rendering code:
Run the trained model and record video
env = gymnasium.make("highway-fast-v0", render_mode="rgb_array")
env = RecordVideo(env, video_folder="./ppo_videos", episode_trigger=lambda e: True)
env.unwrapped.set_record_video_wrapper(env)
env.configure({"simulation_frequency": 15}) # Higher FPS for rendering
model = PPO.load("highway_ppo/model", env=env)
for videos in range(20):
done = truncated = False
obs, info = env.reset()
while not (done or truncated):
action, _states = model.predict(obs, deterministic=True)
obs, reward, done, truncated, info = env.step(action)
env.render()
env.close()
Please provide the specific issue. Thank you!!!
The text was updated successfully, but these errors were encountered:
In the highway_env environment, I have designed the following:
def default_config(cls) -> dict:
cfg = super().default_config()
cfg.update({
"simulation_frequency": 5,
"policy_frequency": 5,
"lanes_count": 3,
"vehicles_count": 30,
"duration": 30, # [s]
"ego_spacing": 1.5,
})
return cfg
Here, the duration is set to 30 seconds. However, when validating the trained PPO policy, the recorded result consistently lasts only 15 seconds, despite no collisions that would terminate the simulation. The following is the testing and rendering code:
Run the trained model and record video
env = gymnasium.make("highway-fast-v0", render_mode="rgb_array")
env = RecordVideo(env, video_folder="./ppo_videos", episode_trigger=lambda e: True)
env.unwrapped.set_record_video_wrapper(env)
env.configure({"simulation_frequency": 15}) # Higher FPS for rendering
model = PPO.load("highway_ppo/model", env=env)
for videos in range(20):
done = truncated = False
obs, info = env.reset()
while not (done or truncated):
action, _states = model.predict(obs, deterministic=True)
obs, reward, done, truncated, info = env.step(action)
env.render()
env.close()
Please provide the specific issue. Thank you!!!
The text was updated successfully, but these errors were encountered: