Could not render SAC pendulum example given in Documentation
See original GitHub issueI have tried Pendulum-v0 animation to run in different codes but the code of stable_baselines docs of SAC only shows me the first frame of pendulum render screen and does not animate throughout.
Here is the code in which I can see the animation:
import gym
env = gym.make('Pendulum-v0')
env.reset()
for i in range(1000):
env.step(env.action_space.sample())
env.render()
Here is the docs code of SAC I found and the animation freezes:
import gym
import numpy as np
from stable_baselines.sac.policies import MlpPolicy
from stable_baselines import SAC
env = gym.make('Pendulum-v0')
model = SAC(MlpPolicy, env, verbose=1)
model.learn(total_timesteps=100000, log_interval=10)
model.save("sac_pendulum")
model = SAC.load("sac_pendulum")
obs = env.reset()
while True:
action, _states = model.predict(obs)
obs, rewards, dones, info = env.step(action)
env.render()
This code runs but the render screen freezes in the first frame:
System Info Stable Baselines[mpi] Installed from pip Ubuntu 16.04 Nvidia GeForce 940m Python version - 3.7.6 Tensorflow version - 1.15.0 (GPU version) Using IPython in terminal
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
SAC — Stable Baselines 2.10.3a0 documentation
The SAC model does not support stable_baselines.common.policies because it uses double q-values and value estimation, as a result it must use its own...
Read more >Pendulum-v0 learned in 5 trials [Explanation in comments]
I was toying around with model-based reinforcement learning based on this paper by Janner et al.: https://arxiv.org/abs/1906.08253 .
Read more >Stable-Baselines3: Reliable Reinforcement Learning ...
You can find more examples and associated colab notebooks in the documentation. To the Infinity and Beyond! We presented Stable-Baselines3 v1.0, ...
Read more >Intro to RLlib: Example Environments | by Paco Nathan
no previous work in reinforcement learning; no previous hands-on experience with RLlib. Key takeaways: we will compare and contrast well-known ...
Read more >Environments - Agents
Python Environments · observation : This is the part of the environment state that the agent can observe to choose its actions at...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What I meant, this should work:
Thanks a lot, it worked!