Files
neuroevolution/sac/replay.py
2025-12-13 14:12:35 +01:00

13 lines
403 B
Python

from stable_baselines3 import TD3
from car_racing_env import CarRacing
test_env = CarRacing(render_mode="human")
best = TD3.load("./td3_run_2_best/best_model.zip", env=test_env)
obs, info = test_env.reset()
done = trunc = False
while not (done or trunc):
action, _ = best.predict(obs, deterministic=True)
obs, r, done, trunc, info = test_env.step(action)
test_env.render()
test_env.close()