I trained a policy with the go2 robot using the retarget_scripts branch, but when I tried to load the policy with play_real.py in pybullet, I received the following message:
"except robot_config.SafetyError as e:
AttributeError: module 'legged_gym.envs.go2_robot.robot_config' has no attribute 'SafetyError'
I am curious as to how you format/convert the mocap data to the specific dataset format in your dataset files. If I want to train A1 with other mocap data, how to get the motion into matching/similar to your format?
(Edit: didn't mean to add "bug" label, just a question. I apologize.)
i just followed readme.md
when running train.py or play.py:
Traceback (most recent call last):
File "../AMP_for_hardware-main/legged_gym/scripts/play.py", line 126, in
play(args)
File "../AMP_for_hardware-main/legged_gym/scripts/play.py", line 58, in play
env, _ = task_registry.make_env(name=args.task, args=args, env_cfg=env_cfg)
File "../AMP_for_hardware-main/legged_gym/utils/task_registry.py", line 97, in make_env
env = task_class( cfg=env_cfg,
File "../AMP_for_hardware-main/legged_gym/envs/base/legged_robot.py", line 90, in init
self.amp_loader = AMPLoader(motion_files=self.cfg.env.amp_motion_files, device=self.device, time_between_frames=self.dt)
File "../AMP_for_hardware-main/rsl_rl/rsl_rl/datasets/motion_loader.py", line 131, in init
self.all_trajectories_full = torch.vstack(self.trajectories_full)
RuntimeError: vstack expects a non-empty TensorList
Describe the bug
It seems like when I replace the robot with 'go1', the limbs become detached from the body. Additionally, in the final learned behavior of 'go1', the front legs move, but the hind legs only spread apart to the sides without any movement. Have you encountered such an issue before, and how should it be resolved?
To Reproduce
Expected behavior
A clear and concise description of what you expected to happen.
System (please complete the following information):
Hello:
Your work is interesting!
How to obtain more motions data (A1 robot)?
The file "dog_clips_info.txt" included many task names, but the file "mocap_motions_a1/" only included several tasks.
I want to use amp training to walk on complex terrain. Have you tried it before? What parameters do you think have a significant impact on terrain adaptability
Describe the bug
It worked fine with CPU but when I switched to GPU, the following error shown many times
RuntimeError: CUDA error: an illegal memory access was encountered
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.
python3 legged_gym/scripts/train.py --task=a1_amp
Importing module 'gym_38' (/home/tianhu/isaacgym/python/isaacgym/_bindings/linux-x86_64/gym_38.so)
Setting GYM_USD_PLUG_INFO_PATH to /home/tianhu/isaacgym/python/isaacgym/_bindings/linux-x86_64/usd/plugInfo.json
PyTorch version 2.0.0+cu118
Device count 1
/home/tianhu/isaacgym/python/isaacgym/_bindings/src/gymtorch
Using /home/tianhu/.cache/torch_extensions/py38_cu118 as PyTorch extensions root...
Emitting ninja build file /home/tianhu/.cache/torch_extensions/py38_cu118/gymtorch/build.ninja...
Building extension module gymtorch...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
ninja: no work to do.
Loading extension module gymtorch...
Setting seed: 1
Not connected to PVD
+++ Using GPU PhysX
Physics Engine: PhysX
Physics Device: cuda:0
GPU Pipeline: enabled
/home/tianhu/anaconda3/envs/amp_hw/lib/python3.8/site-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3483.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
Loaded 2.499s. motion from datasets/mocap_motions/rightturn0.txt.
Loaded 10.311s. motion from datasets/mocap_motions/pace1.txt.
Loaded 0.798s. motion from datasets/mocap_motions/pace0.txt.
Loaded 0.672s. motion from datasets/mocap_motions/trot1.txt.
Loaded 0.672s. motion from datasets/mocap_motions/trot0.txt.
Loaded 0.9450000000000001s. motion from datasets/mocap_motions/leftturn0.txt.
AMPOnPolicyRunner
Actor MLP: Sequential(
(0): Linear(in_features=42, out_features=512, bias=True)
(1): ELU(alpha=1.0)
(2): Linear(in_features=512, out_features=256, bias=True)
(3): ELU(alpha=1.0)
(4): Linear(in_features=256, out_features=128, bias=True)
(5): ELU(alpha=1.0)
(6): Linear(in_features=128, out_features=12, bias=True)
)
Critic MLP: Sequential(
(0): Linear(in_features=48, out_features=512, bias=True)
(1): ELU(alpha=1.0)
(2): Linear(in_features=512, out_features=256, bias=True)
(3): ELU(alpha=1.0)
(4): Linear(in_features=256, out_features=128, bias=True)
(5): ELU(alpha=1.0)
(6): Linear(in_features=128, out_features=1, bias=True)
)
Loaded 2.499s. motion from datasets/mocap_motions/rightturn0.txt.
Loaded 10.311s. motion from datasets/mocap_motions/pace1.txt.
Loaded 0.798s. motion from datasets/mocap_motions/pace0.txt.
Loaded 0.672s. motion from datasets/mocap_motions/trot1.txt.
Loaded 0.672s. motion from datasets/mocap_motions/trot0.txt.
Loaded 0.9450000000000001s. motion from datasets/mocap_motions/leftturn0.txt.
Preloading 2000000 transitions
Finished preloading
PxgCudaDeviceMemoryAllocator fail to allocate memory 339738624 bytes!! Result = 2
[Error] [carb.gym.plugin] Gym cuda error: an illegal memory access was encountered: ../../../source/plugins/carb/gym/impl/Gym/GymPhysX.cpp: 4210
[Error] [carb.gym.plugin] Gym cuda error: an illegal memory access was encountered: ../../../source/plugins/carb/gym/impl/Gym/GymPhysX.cpp: 3480
[Error] [carb.gym.plugin] Gym cuda error: an illegal memory access was encountered: ../../../source/plugins/carb/gym/impl/Gym/GymPhysX.cpp: 3535
[Error] [carb.gym.plugin] Gym cuda error: an illegal memory access was encountered: ../../../source/plugins/carb/gym/impl/Gym/GymPhysX.cpp: 6137
[Error] [carb.gym.plugin] Gym cuda error: an illegal memory access was encountered: ../../../source/plugins/carb/gym/impl/Gym/GymPhysXCuda.cu: 991
Traceback (most recent call last):
File "legged_gym/scripts/train.py", line 47, in
train(args)
File "legged_gym/scripts/train.py", line 42, in train
ppo_runner, train_cfg = task_registry.make_alg_runner(env=env, name=args.task, args=args)
File "/home/tianhu/AMP_for_hardware/legged_gym/utils/task_registry.py", line 149, in make_alg_runner
runner = runner_class(env, train_cfg_dict, log_dir, device=args.rl_device)
File "/home/tianhu/AMP_for_hardware/rsl_rl/rsl_rl/runners/amp_on_policy_runner.py", line 104, in init
_, _ = self.env.reset()
File "/home/tianhu/AMP_for_hardware/legged_gym/envs/base/legged_robot.py", line 99, in reset
obs, privileged_obs, _, _, _, _, _ = self.step(torch.zeros(self.num_envs, self.num_actions, device=self.device, requires_grad=False))
File "/home/tianhu/AMP_for_hardware/legged_gym/envs/base/legged_robot.py", line 113, in step
self.torques = self._compute_torques(self.actions).view(self.torques.shape)
File "/home/tianhu/AMP_for_hardware/legged_gym/envs/base/legged_robot.py", line 431, in _compute_torques
actions_scaled = actions * self.cfg.control.action_scale
RuntimeError: CUDA error: an illegal memory access was encountered
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.
Describe the bug
Hi, the problem I meet now is the low speed for training. I remember you presented a result that the training was finished in 20 minutes, while executing the program by myself costed about 9-10 days. Do you know what happened with it? And what were commands you used in the terminal when you operated the program?
To Reproduce
Steps to reproduce the behavior:
cd AMP_for_hardware/
Then use ‘’’python legged_gym/scripts/train.py —task=a1_amp —headless —num_envs=1000 ‘’’
The terminal shows Iteration time is about 1.76s, ETA is about 760000s
Expected behavior
I hope I can reproduce your result that spending about 20minutes finishes the train. Do you know what happened with it that the training speed is too slow? And what were commands you input to the terminal when you operated the program?
System (please complete the following information):
OS: Centos7
GPU: Intel A100(80G), Note: the usage is 37% when I operate the train.py
Hi @Alescontrela I'm trying to reproduce the hopturn result using the provided hopturn dataset, I'm wondering what's your training setting for the hopturn task, if possible can you share the config used for the hopturn task?
Describe the bug
I check the website https://sites.google.com/berkeley.edu/amp-in-real/home experiment result, from the result "Informal race between Fu et al.* (left) and AMP Policy (right)", we could see A1 could run at a very high speed, but I check the trot0 and trot1 data from datasets file, it seems these data are not related to race, if yes, could you provide motion data related to race experiment? Thanks!
To Reproduce
Steps to reproduce the behavior:
Execute ./path/script arg1 arg2
Then ...
See error: ...
Expected behavior
A clear and concise description of what you expected to happen.
System (please complete the following information):
Then report no logs run file
I assume that you didn't put the saved agent policy model file which you used in the code file, could you release it?
And could you give a guide how to implement the code in Unitree A1? I will appreciate it very much!
.
Hi Alescontrela,
Thanks for your great job on amp_for_hardware!
I can train it on a1, it is awesome. I have a question that I find that your mocap data is txt file and issacgym offical data, ase/amp mocap data is npy file. I want to try humanoid motion data on your repo. could you tell me how to translate that data?
I noticed that your code AMP_LOADER has 'reorder_from_pybullet_to_isaac', is that translated by pybullet?
Thanks!
Thank you very much for sharing your work! it is awesome :)
I want to work with my quadruped robot. However, after many attempts and changes in the configurations, I still don’t know what's going wrong.
Please can you give me an idea of what's wrong with my settings to make my quadruped robot behave so strangely from the start, as you can see in the video below?
test_compressed.mp4
I generated the reference motions using this repository for my robot configuration, and it was looking fine.
I’ve created a robot class for this robot and modified some parameters to my robot config: