Hi, hope you are doing well! I had a question about how to use model-based wrappers inside IsaacGym, particularly the IsaacGymEnvs interface for CUDA.
I am working on model-based learning inside IsaacGym, and have trained an ensemble of synthetic models in PyTorch to predict the next state (or difference between next state and current state) over an offline dataset. I am currently using this repo for my research. I want to use those models as a base of a Gym wrapper over an IsaacGym VecTask. I have run into a few errors in trying to test this model, particularly through the testing file in the base directory of the repo linked above. In particular, I have run into the following errors:
When I run with the sim device and RL device both being the GPU (standard NVIDIA RTX GeoForce 2080TI for these runs), I run into an error saying the following:
Error[carb.gym.plugin]: Function GymGetActorDofStates cannot be used with the GPU pipeline after simulation starts. Please use the tensor API if possible.
I don’t think this should be a problem, as I just wrap around the standard env.reset() and env.step(actions) functions present in any standard VecTask.
When I change the sim device to the CPU but keep the RL device as the GPU, this error occurs for some reason.
The particular error occurs when gymtorch tries to wrap the sensor tensor in line 86 of humanoid_amp_base.py in the IsaacGym repo, particularly
RuntimeError: shape [4096 (num_envs), 12] is invalid for input of size 98304.
Again, I’m not sure why this is happening. Additional logs (see below) reveal that the number of actuators randomly doubles for me, which I don’t think should be happening with the same env. This also seems to explain the reason behind the shape problem, as the shape of the fetched tensor is double the size it needs to be.
I’ve snooped around the repo for a while, but can’t really figure out the fix at all. What is the fix for this? This is crucial to my research so I’d like to know this as soon as possible. I don’t think I made any crazy large mistakes in env handling in the gym wrapper, but please let me know where I can debug this. I am also willing to hop on a video chat or something in case anyone who can help wants to see the error live and can co-debug with me. Thanks so much!