I trying to train RL algorihms from stable_baselines to control a wind turbine in gym-wind-turbine. I run the code for learning RL agent in WindTurbineStepwise-v0 env. The code is running without errors. However, I get empty simulation plots (without lines). Below, the example with TPRO algorithm (the same problem is with DDPG, SAC, PRO etc)
def run_TRPO_control_actions():
wt = gym.make('WindTurbineStepwise-v0')
wt = DummyVecEnv([lambda: wt])
model = TRPO(MlpPolicy, wt, verbose=1)
model.learn(total_timesteps=50000)
model.save("trpo_turbine")
del model # remove to demonstrate saving and loading
model = TRPO.load("trpo_turbine")
print("Episode using real control with Stepwise Wind")
done = False
observation = wt.reset()
while not done:
action = model.predict(observation)
observation, reward, done, info = wt.step(action)
wt.render()
I have two guesses
- RL agent doesn't find an optimal policy and therefhore while the environment is not done, the RL algorithm cannot decide correctly what to do. As results, we don't have some simulations for the plot. The same is with running
run_random_actions(). As results, we get empty simulation plots.
- This problem is somehow related to vectorized environments in stable_baselines. Instead of training an RL agent on 1 environment, it allows us to train it on n environments using n processes.
I trying to train RL algorihms from stable_baselines to control a wind turbine in gym-wind-turbine. I run the code for learning RL agent in
WindTurbineStepwise-v0env. The code is running without errors. However, I get empty simulation plots (without lines). Below, the example with TPRO algorithm (the same problem is with DDPG, SAC, PRO etc)I have two guesses
run_random_actions(). As results, we get empty simulation plots.