Closed CreativeNick closed 2 weeks ago
https://github.com/CreativeNick/SimToReal/blob/bf2bb092414742bb381575063f84876acf5f7e77/bimanual-sapien/envs/ycb_env.py#L78 is the line that randomizes your models. You should seed with a RNG (you can use self.np_random instead of np.random). self.np_random
will be seeded by the seed passed to env.reset(seed=seed)
Are there any built-in features to evaluate the run using the same object that was used in training, or is that something I would need to tweak? Using self.np_random
I was able to generate random YCB models each time, but I'd like to also maintain the same model for both training & evaluation.
You will have to write code to do that to e.g. upon env creation limit which YCB models are loaded. You could modify the task to accept a new argument in the init function of the env class to accept a list of model IDs, and the env will only sample from that list.
@CreativeNick is this still an issue?
I'm building this custom environment and am having trouble with loading in a randomized YCB object. I would like it so when I run the command
python ppo.py --env-id Bimanual_Allegro_YCB
, a newly randomly generated YCB model is generated. So for example, if I ran the command the first time, it would train using004_sugar_box
, and when I run it a second time, it would train using072-c_toy_airplane
. When I evaluate these runs, they would use their respective model used when training. However, when running the command multiple times, it always ends up using the same model. It would select model052_extra_large_clamp
, and then select another model, the object being011_banana
. I have an example output below.I setup a print statement to output which model it chooses. For some reason, when I simply view the environment using my own
view_ycb_env.py
file, it is able to generate a uniquely random model each time. This leads me to believe that this issue is happening because of how the seed works inppo.py
.Link to files for reference:
ycb_env.py
(environment file)view_ycb_env.py
(used to view environment)ppo.py
(this file is essentially the same as theppo.py
file in this repo, with only differences in formatting and class args like num_steps)