Comments (5)
Hi @aravindr93, this is due to we haven't fully migrated to using the mujoco-py package yet, and rllab has its own mujoco setup instructions available as a bash script here: https://github.com/rllab/rllab/blob/master/scripts/setup_mujoco.sh
Alternatively, you can try changing the import statements import rllab.mujoco_py
into import mujoco_py
. I expect this to mostly work except maybe a few interface differences that should be easy to fix.
from rllab.
@dementrock Thanks. I'll try it out.
I have a related question: how different are the gym environments ported through rllab and the original gym environments. More specifically between gym_env
and rllab_env1
in my prev comment.
I'm trying out a project to test robustness to model errors. For this, I need to perturb the model parameters when required and then test a pre-trained policy on this perturbed model. The env created through gym allows me to do: gym_env.model.<data>
to change whatever I want. However, I don't get the same functionality with rllab_env1
. Is it the same case if I import HopperEnv from rllab.envs.mujoco.hopper_env
?
Alternatively, what is the easiest way to train a policy on the environment created uisng gym_env = gym.make('Hopper-v1')
without using the GymEnv
wrapper? Thanks!
from rllab.
Hi @aravindr93, in general environments in gym are more polished, and, to my knowledge, some of the environment parameters are tweaked when ported into gym. If gym's environments fit your need I recommend using them directly.
Can you elaborate on why you want to train a policy without using the wrapper?
from rllab.
OK, I think I didn't explain the issue properly.
What I want to do is learn a policy on an environment; perturb the parameters of the environment; and test the returns in the perturbed environments. To perturb the parameters, what I would do is something like this:
import gym
gym_env = gym.make('Hopper-v1')
gym_env.model.body_mass = new_mass
(this requires creating a mutable copy as intermediate step). This doesn't seem to be possible when I get the model using GymEnv wrapper.
from rllab.envs.gym_env import GymEnv
rllab_env = GymEnv("Hopper-v1")
print rllab_env.model
AttributeError: 'GymEnv' object has no attribute 'model'
When we train a policy (say GaussianMLP), we usually pass on an env.spec that comes from a rllab env object. However, this spec is different from the specs of gym. Can you give me a few lines of code to train a policy on a gym environment without the GymEnv() wrapper? Thanks!
from rllab.
I see. Right now this is not achievable using the current interface. If you look at the implementation of GymEnv
though, it's just a very thin wrapper on top of environments from gym. You could write a similar class that takes in an already constructed gym environment as input, rather than just the ID of the environment.
To access the model properly in the last example you can do print rllab_env.env.model
.
from rllab.
Related Issues (20)
- gym.wrappers.monitoring import error HOT 1
- Problem running rllab MazeAntEnv HOT 2
- ImportError: cannot import name 'MemmapingPool' HOT 8
- How to record videos in SwimmerGatherEnv
- Error Using Custom Env + GaussianGRU + VPG
- Docker intended running environment HOT 2
- Gaussian Policy - no inputs
- can not find files vendor/mujoco/ HOT 4
- Dockerfiles unnecessarily large
- AttributeError: 'NoneType' object has no attribute 'put' HOT 1
- Difference between std_hidden_nonlinearity and hidden_nonlinearity?
- gradient descent to optimize the TRPO or PPO algorithm?
- No module named 'cached_property' HOT 1
- How to improve the GPU-Util when running RL program with RLLab. HOT 2
- setup_linux.sh always exits before creating environment
- Error while instantiating <class 'rllab.envs.gym_env.GymEnv'> HOT 1
- [Installation Issue]: ResolvePackageNotFound HOT 2
- How to test trained model??
- ResolvePackageNotFound:
- Stuck while training at 977 itr
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rllab.