We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using the gym engine, the human render screen does not always appear.
Create object (for example pendulum-v1) with gym engine and single process backend. Then call env.render("human") and train with sb3.
import eagerx from eagerx_dcsc_setups.pendulum.objects import Pendulum from eagerx_dcsc_setups.pendulum.envs import PendulumEnv from eagerx.engines.openai_gym.engine import GymEngine from eagerx.wrappers import Flatten from eagerx.backends.single_process import SingleProcess import stable_baselines3 as sb3 import gym.wrappers as w if __name__ == "__main__": rate = 20 # Create pendulum object pendulum = Pendulum.make( "pendulum", actuators=["u"], sensors=["x", "image"], states=["model_state", "max_speed", "length"], actuator_rate=rate, sensor_rate=rate, ) # Create graph graph = eagerx.Graph.create() graph.add(pendulum) graph.connect(action="voltage", target=pendulum.actuators.u) graph.connect(source=pendulum.sensors.x, observation="angle_data") graph.render(source=pendulum.sensors.image, rate=rate) gym_engine = GymEngine.make(rate=rate, process=eagerx.ENVIRONMENT) backend = SingleProcess.make() # Create envs train_env = PendulumEnv( name="TrainEnv", rate=rate, graph=graph, engine=gym_engine, backend=backend, ) train_env = w.rescale_action.RescaleAction(Flatten(train_env), min_action=-1.0, max_action=1.0) train_env.render("human") model = sb3.SAC("MlpPolicy", train_env, verbose=1, learning_rate=7e-4) model.learn(total_timesteps=5000)
Render screen opening. Note that a workaround is to do an extra reset before training.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
🐛 Bug
When using the gym engine, the human render screen does not always appear.
To Reproduce
Create object (for example pendulum-v1) with gym engine and single process backend.
Then call env.render("human") and train with sb3.
Expected behavior
Render screen opening.
Note that a workaround is to do an extra reset before training.
The text was updated successfully, but these errors were encountered: