Giter VIP home page Giter VIP logo

mocapact's Introduction

MoCapAct

montage

Code License      Dataset License

Paper: MoCapAct: A Multi-Task Dataset for Simulated Humanoid Control

This is the codebase for the MoCapAct project, which uses motion capture (MoCap) clips to learn low-level motor skills for the "CMU Humanoid" from the dm_control package. This repo contains all code to:

  • train the clip snippet experts,
  • collect expert rollouts into a dataset,
  • download our experts and rollouts from the command line,
  • perform policy distillation,
  • perform reinforcement learning on downstream tasks, and
  • perform motion completion.

For more information on the project and to download the entire dataset, please visit the project website.

For users interested in development, we recommend reading the following documentation on dm_control:

Setup

MoCapAct requires Python 3.7+. We recommend that you use a virtual environment. For example, using conda:

conda create -n MoCapAct pip python==3.8
conda activate MoCapAct

To install the package, we recommend cloning the repo and installing the local copy:

git clone https://github.com/microsoft/MoCapAct.git
cd MoCapAct
pip install -e .

Dataset

The MoCapAct dataset consists of clip experts trained on the MoCap snippets and the rollouts from those experts.

Downloading the Dataset

We recommend using Azure Storage Explorer to download the dataset, which we detail below.

Azure Storage Explorer

First, install Azure Storage Explorer. This can be done with snap:

sudo snap install storage-explorer

Then, open Azure Storage Explorer. Click the "Open Connect Dialog" button.

montage

In the "Connect to Azure Storage" window that opens, click the "Blob container or directory" option.

montage

Select "Shared access signature URL (SAS)" and click "Next".

montage

In an Internet browser, go to the MoCapAct page on Microsoft Research and copy the link given by the "Download Dataset" button.

montage

In Azure Storage Explorer, paste the copied URL into the "Blob container or directory SAS URL" box. Put a desired name in the "Display name" box (e.g., "MoCapAct"). Click "Next" and then "Connect".

montage

If successful, you should see the dataset files in the window.

montage

Alternatively, the AzCopy program can be used to download files from the command line.

AzCopy

Download the AzCopy tar file from the product page (direct link to x86 Linux tar file). Unzip the file and then go to the AzCopy directory:

tar -xf /path/to/azcopy.tar.gz
cd /path/to/azcopy

Next, use the azcopy command to download the desired file from the MoCapAct blob.

file=README.md # use the empty string "" to download everything in the blob

# Source URL can be copied from "Download Dataset" in Microsoft Research page:
# https://www.microsoft.com/en-us/research/publication/mocapact-a-multi-task-dataset-for-simulated-humanoid-control/
# Note the presence of `${file}$` in the middle of `src` and backslashes `\` before `?`, `=`, and `&`.
src=https://msropendataset01.blob.core.windows.net/motioncapturewithactionsmocapact-u20220731/${file}\?sp\=rl\&st\=2023-08-22T17:20:43Z\&se\=2026-07-02T01:20:43Z\&spr\=https\&sv\=2022-11-02\&sr\=c\&sig\=L9f3Y8jAz3SCoAM5U5g9uCs0pmTI40rDLh2ZGC7OxE8%3D

./azcopy copy $src /path/to/dst --recursive

The value for file can be any of the files in the MoCapAct blob, shown below.

montage

Finally, we provide an AzCopy-based Python script to download portions of the dataset, though this method has much slower download speeds than the other two methods.

Python script

The script takes the following flags:

  • -t: a type from <experts | small_dataset | large_dataset>,
  • -c: a comma-separated list of clips (e.g., CMU_001_01,CMU_009_12) or a specific subset from dm_control's MoCap subsets <get_up | walk_tiny | run_jump_tiny | locomotion_small | all>, and
  • -d: a destination path.

For example:

python -m mocapact.download_dataset -t experts -c CMU_009_12 -d ./data
python -m mocapact.download_dataset -t small_dataset -c CMU_001_01,CMU_009_12 -d ./data

Description

Clip snippet experts We signify a clip snippet expert by the snippet it is tracking. Taking CMU_009_12-165-363 as an example expert, the file hierarchy for the snippet expert is:
CMU_009_12-165-363
├── clip_info.json         # Contains clip ID, start step, and end step
└── eval_rsi/model
    ├── best_model.zip     # Contains policy parameters and hyperparameters
    └── vecnormalize.pkl   # Used to get normalizer for observation and reward

The expert policy can be loaded using our repository:

from mocapact import observables
from mocapact.sb3 import utils
expert_path = "data/experts/CMU_009_12-165-363/eval_rsi/model"
expert = utils.load_policy(expert_path, observables.TIME_INDEX_OBSERVABLES)

from mocapact.envs import tracking
from dm_control.locomotion.tasks.reference_pose import types
dataset = types.ClipCollection(ids=['CMU_009_12'], start_steps=[165], end_steps=[363])
env = tracking.MocapTrackingGymEnv(dataset)
obs, done = env.reset(), False
while not done:
    action, _ = expert.predict(obs, deterministic=True)
    obs, rew, done, _ = env.step(action)
    print(rew)
Expert rollouts The expert rollouts consist of a collection of HDF5 files, one per clip. An HDF5 file contains expert rollouts for each constituent snippet as well as miscellaneous information and statistics. To facilitate efficient loading of the observations, we concatenate all the proprioceptive observations (joint angles, joint velocities, actuator activations, etc.) from an episode into a single numerical array and provide indices for the constituent observations in the observable_indices group.

Taking CMU_009_12.hdf5 (which contains three snippets) as an example, we have the following HDF5 hierarchy:

CMU_009_12.hdf5
├── n_rsi_rollouts                # R, number of rollouts from random time steps in snippet
├── n_start_rollouts              # S, number of rollouts from start of snippet
├── ref_steps                     # Indices of MoCap reference relative to current time step. Here, (1, 2, 3, 4, 5).
├── observable_indices
│   └── walker
│       ├── actuator_activation   # (0, 1, ..., 54, 55)
│       ├── appendages_pos        # (56, 57, ..., 69, 70)
│       ├── body_height           # (71)
│       ├── ...
│       └── world_zaxis           # (2865, 2866, 2867)
│
├── stats                         # Statistics computed over the entire dataset
│   ├── act_mean                  # Mean of the experts' sampled actions
│   ├── act_var                   # Variance of the experts' sampled actions
│   ├── mean_act_mean             # Mean of the experts' mean actions
│   ├── mean_act_var              # Variance of the experts' mean actions
│   ├── proprio_mean              # Mean of the proprioceptive observations
│   ├── proprio_var               # Variance of the proprioceptive observations
│   └── count                     # Number of observations in dataset
│
├── CMU_009_12-0-198              # Rollouts for the snippet CMU_009_12-0-198
├── CMU_009_12-165-363            # Rollouts for the snippet CMU_009_12-165-363
└── CMU_009_12-330-529            # Rollouts for the snippet CMU_009_12-330-529

Each snippet group contains $R+S$ snippets. The first $S$ episodes correspond to episodes initialized from the start of the snippet and the last $R$ episodes to episodes initialized at random points in the snippet. We now uncollapse the CMU_009_12-165-363 group within the HDF5 file to reveal the rollout structure:

CMU_009_12-165-363
├── early_termination                  # (R+S)-boolean array indicating which episodes terminated early
├── rsi_metrics                        # Metrics for episodes that initialize at random points in snippet
│   ├── episode_returns                # R-array of episode returns
│   ├── episode_lengths                # R-array of episode lengths
│   ├── norm_episode_returns           # R-array of normalized episode rewards
│   └── norm_episode_lengths           # R-array of normalized episode lengths
├── start_metrics                      # Metrics for episodes that initialize at start in snippet
│
├── 0                                  # First episode, of length T
│   ├── observations
│   │   ├── proprioceptive             # (T+1)-array of proprioceptive observations
│   │   ├── walker/body_camera         # (T+1)-array of images from body camera **(not included)**
│   │   └── walker/egocentric_camera   # (T+1)-array of images from egocentric camera **(not included)**
│   ├── actions                        # T-array of sampled actions executed in environment
│   ├── mean_actions                   # T-array of corresponding mean actions
│   ├── rewards                        # T-array of rewards from environment
│   ├── values                         # T-array computed using the policy's value network
│   └── advantages                     # T-array computed using generalized advantage estimation
│
├── 1                                  # Second episode
├── ...
└── R+S-1                              # (R+S)th episode

To keep the dataset size manageable, we do not include image observations in the dataset. The camera images can be logged by providing the flags --log_all_proprios --log_cameras to the mocapact/distillation/rollout_experts.py script.

The HDF5 rollouts can be read and utilized in Python:

import h5py
dset = h5py.File("data/small_dataset/CMU_009_12.hdf5", "r")
print("Expert actions from first rollout episode of second snippet:")
print(dset["CMU_009_12-165-363/0/actions"][...])

We provide a "large" dataset where $R = S = 100$ (with size 600 GB) and a "small" dataset where $R = S = 10$ (with size 50 GB).

Examples

Below are Python commands we used for our paper.

Clip snippet experts

Training a clip snippet expert:

python -m mocapact.clip_expert.train \
  --clip_id [CLIP_ID] `# e.g., CMU_016_22` \
  --start_step [START_STEP] `# e.g., 0` \
  --max_steps [MAX_STEPS] `# e.g., 210 (can be larger than clip length)` \
  --n_workers [N_CPU] `# e.g., 8` \
  --log_root experts \
  $(cat cfg/clip_expert/train.txt)

Evaluating a clip snippet expert (numerical evaluation and visual evaluation):

python -m mocapact.clip_expert.evaluate \
  --policy_root [POLICY_ROOT] `# e.g., experts/CMU_016-22-0-82/0/eval_rsi/model` \
  --n_workers [N_CPU] `# e.g., 8` \
  --n_eval_episodes 1000 `# set to 0 to just run the visualizer` \
  $(cat cfg/clip_expert/evaluate.txt)

We can also load the experts in Python:

from mocapact import observables
from mocapact.sb3 import utils
expert_path = "experts/CMU_016_22-0-82/0/eval_rsi/model" # example path
expert = utils.load_policy(expert_path, observables.TIME_INDEX_OBSERVABLES)

from mocapact.envs import tracking
from dm_control.locomotion.tasks.reference_pose import types
dataset = types.ClipCollection(ids=['CMU_016_22'])
env = tracking.MocapTrackingGymEnv(dataset)
obs, done = env.reset(), False
while not done:
    action, _ = expert.predict(obs, deterministic=True)
    obs, rew, done, _ = env.step(action)
    print(rew)
Creating rollout dataset

Rolling out a collection of experts and collecting into a dataset:

python -m mocapact.distillation.rollout_experts \
  --input_dirs [EXPERT_ROOT] `# e.g., experts` \
  --n_workers [N_CPU] `# e.g., 8` \
  --device [DEVICE] `# e.g., cuda` \
  --output_path dataset/file_name_ignored.hdf5 \
  $(cat cfg/rollout.txt)

This will result in a collection of HDF5 files (one per clip), which can be read and utilized in Python:

import h5py
dset = h5py.File("dataset/CMU_016_22.hdf5", "r")
print("Expert actions from first rollout episode:")
print(dset["CMU_016_22-0-82/0/actions"][...])
Multi-clip policy

Training a multi-clip policy on the entire MoCapAct dataset:

source scripts/get_all_clips.sh [PATH_TO_DATASET]
python -m mocapact.distillation.train \
  --train_dataset_paths $train \
  --val_dataset_paths $val \
  --dataset_metrics_path $metrics \
  --extra_clips $clips \
  --output_root multi_clip/all \
  --gpus 0 `# indices of GPUs` \
  $(cat cfg/multi_clip/train.txt) \
  $(cat cfg/multi_clip/rwr.txt) `# rwr can be replaced with awr, cwr, or bc` \
  --model.config.embed_size 60 \
  --eval.n_workers [N_CPU] `# e.g., 16`

Training a multi-clip policy on the locomotion subset of the MoCapAct dataset:

source scripts/get_locomotion_clips.sh [PATH_TO_DATASET]
python -m mocapact.distillation.train \
  --train_dataset_paths $train \
  --dataset_metrics_path $metrics \
  --extra_clips $clips \
  --output_root multi_clip/locomotion \
  --gpus 0 `# indices of GPUs` \
  $(cat cfg/multi_clip/train.txt) \
  $(cat cfg/multi_clip/rwr.txt) `# rwr can be replaced with awr, cwr, or bc` \
  --model.config.embed_size 20 \
  --eval.n_workers [N_CPU] `# e.g., 16`

Evaluating a multi-clip policy on all the snippets within the MoCapAct dataset (numerical evaluation and visual evaluation):

source scripts/get_all_clips.sh [PATH_TO_DATASET]
python -m mocapact.distillation.evaluate \
  --policy_path [POLICY_PATH] `# e.g., multi_clip/all/eval/train_rsi/best_model.ckpt` \
  --clip_snippets $snippets \
  --n_workers [N_CPU] `# e.g., 8` \
  --device [DEVICE] `# e.g., cuda` \
  --n_eval_episodes 1000 `# set to 0 to just run the visualizer` \
  $(cat cfg/multi_clip/evaluate.txt)

The multi-clip policy can be loaded using PyTorch Lightning's functionality to interact with the environment:

from mocapact.distillation import model
model_path = "multi_clip/all/eval/train_rsi/best_model.ckpt"
policy = model.NpmpPolicy.load_from_checkpoint(model_path, map_location="cpu")

from mocapact.envs import tracking
from dm_control.locomotion.tasks.reference_pose import cmu_subsets
dataset = cmu_subsets.ALL
ref_steps = (1, 2, 3, 4, 5)
env = tracking.MocapTrackingGymEnv(dataset, ref_steps)
obs, done = env.reset(), False
embed = policy.initial_state(deterministic=False)
while not done:
    action, embed = expert.predict(obs, state=embed, deterministic=False)
    obs, rew, done, _ = env.step(action)
    print(rew)
RL transfer tasks

Training a task policy (here, with a pre-defined low-level policy):

python -m mocapact.transfer.train \
  --log_root [LOG_ROOT] `# e.g., transfer/go_to_target` \
  $(cat cfg/transfer/train.txt) \
  $(cat cfg/transfer/go_to_target.txt) `# set to cfg/transfer/velocity_control.txt for velocity control` \
  $(cat cfg/transfer/with_low_level.txt) `# set to cfg/transfer/no_low_level.txt for no low-level policy`

Evaluating a task policy:

python -m mocapact.transfer.evaluate \
  --model_root [MODEL_ROOT] `# e.g., transfer/go_to_target/0/eval/model` \
  --task [TASK] `# e.g., mocapact/transfer/config.py:go_to_target or velocity_control`
Motion completion

Training a GPT policy on the entire MoCapAct dataset:

source scripts/get_all_clips.sh [PATH_TO_DATASET]
python -m mocapact.distillation.train \
  --train_dataset_paths $train \
  --val_dataset_paths $val \
  --dataset_metrics_path $metrics \
  --output_root motion_completion \
  $(cat cfg/motion_completion/train.txt)

Performing motion completion with a trained GPT policy:

python -m mocapact.distillation.motion_completion \
  --policy_path [POLICY_PATH] `# e.g., motion_completion/model/last.ckpt` \
  --expert_root [EXPERT_ROOT] `# e.g., experts` \
  --clip_snippet [CLIP_SNIPPET] `# e.g., CMU_016_22` \
  --n_workers [N_CPU] `# e.g., 8` \
  --device [DEVICE] `# e.g., cuda` \
  --n_eval_episodes 100 `# Set to 0 to just run the visualizer` \
  $(cat cfg/motion_completion/evaluate.txt)

To generate a prompt, we also input a path to the directory of snippet experts. Alternatively, you can pass a path to a multi-clip policy through --distillation_path, though it will likely produce lower-quality prompts than the snippet experts.

Dataset Interface

We provide two datasets in this repo. The ExpertDataset is used to perform imitation learning, e.g., to train a multi-clip tracking policy or a GPT policy for motion completion. The D4RLDataset is used for offline reinforcement learning. For small enough instantiations of the datasets that fit into memory, the user can use D4RLDataset.get_in_memory_rollouts() to load a batch of transitions into memory. For instantiations that do not fit into memory (e.g., the entire MoCapAct dataset), the user can use the dataset as a PyTorch Dataset by using an iterator over the transitions obtained by using __getitem__().

Future Plans

We are happy to work with the community to fix bugs and expand functionality of MoCapAct. This will include incorporating pull requests and allowing for MoCap clips to be added in the form of HDF5 files.

Citation

If you reference or use MoCapAct in your research, please cite:

@inproceedings{wagener2022mocapact,
  title={{MoCapAct}: A Multi-Task Dataset for Simulated Humanoid Control},
  author={Wagener, Nolan and Kolobov, Andrey and Frujeri, Felipe Vieira and Loynd, Ricky and Cheng, Ching-An and Hausknecht, Matthew},
  booktitle={Advances in Neural Information Processing Systems},
  volume={35},
  pages={35418--35431},
  year={2022}
}

Licenses

The code is licensed under the MIT License. The dataset is licensed under the CDLA Permissive v2 License.

mocapact's People

Contributors

microsoft-fevieira avatar microsoft-github-policy-service[bot] avatar nolanwagener avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mocapact's Issues

Error while trying to fetch the experts

Hi I seem to be running into some authentication error while trying to get the expert clips using
python -m mocapact.download_dataset -t experts -c CMU_009_12 -d ./data

the error that I get is


Downloading experts dataset from: https://mocapact.blob.core.windows.net/public?sv=2020-10-02&si=public-1819108CAA5&sr=c&sig=Jw1zsVs%2BK2G6QP%2Bo%2FFPQb1rSUY8AL%2F24k4zhQuw5WPo%3D to ./data
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/rakesh/Desktop/project/MoCapAct/mocapact/download_dataset.py", line 107, in <module>
    download_dataset_from_url(DATASET_URL, blob_prefix, local_dest_path=args.dest_path, clips=expanded_clips)
  File "/home/rakesh/Desktop/project/MoCapAct/mocapact/download_dataset.py", line 25, in download_dataset_from_url
    for blob in expert_blobs:
  File "/home/rakesh/anaconda3/envs/monet/lib/python3.11/site-packages/azure/core/paging.py", line 123, in __next__
    return next(self._page_iterator)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rakesh/anaconda3/envs/monet/lib/python3.11/site-packages/azure/core/paging.py", line 75, in __next__
    self._response = self._get_next(self.continuation_token)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/rakesh/anaconda3/envs/monet/lib/python3.11/site-packages/azure/storage/blob/_list_blobs_helper.py", line 79, in _get_next_cb
    process_storage_error(error)
  File "/home/rakesh/anaconda3/envs/monet/lib/python3.11/site-packages/azure/storage/blob/_shared/response_handlers.py", line 177, in process_storage_error
    exec("raise error from None")   # pylint: disable=exec-used # nosec
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 1, in <module>
azure.core.exceptions.ClientAuthenticationError: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:6447f222-401e-001e-15fb-990a08000000
Time:2024-04-29T06:09:40.8774697Z
ErrorCode:AuthenticationFailed
authenticationerrordetail:Signature did not match. String to sign used was 


/blob/mocapact/public
public-1819108CAA5


2020-10-02
c






Content: <?xml version="1.0" encoding="utf-8"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:6447f222-401e-001e-15fb-990a08000000
Time:2024-04-29T06:09:40.8774697Z</Message><AuthenticationErrorDetail>Signature did not match. String to sign used was 


/blob/mocapact/public
public-1819108CAA5


2020-10-02
c





</AuthenticationErrorDetail></Error>


I am not sure what is the issue here, about a month ago I had managed to fetch the clips using the same command not sure why it's not working now.

Thank you

Unusual Trend in Validation Loss

Hi,

Thanks for your help in advance.
I tried to reproduce the result for the motion completion, I trained the GPT policy and visualized the action prediction in MuJoCo. I stopped the training early, thinking that I might have made a mistake since the validation losses did not follow the usual trend (following a decreasing trend) and there might have been a possibility of overfitting.
However, the visualization in MuJoCo looked fine, indicating that the model has learnt to predict the actions quite well.
Is there any reason why the validation losses are misleading? Or am I interpreting them wrong?

MotionCompletionGraph

Please find the reproduced results attached to this message. The model was trained on the 600 GB dataset and I have used different values of learning rate, batch_size, and validation frequency, but the increasing trend is observed in most.

Thanks again for your help.

Error while running the evaluate policy

Hi I ran the evaluate policy as mentioned
python mocapact/clip_expert/evaluate.py --policy_root data/experts/CMU_009_12-165-363/eval_rsi/model --always_init_at_clip_start --device cpu --ghost_offset 1 --act_noise 0
This throws an error as

ialization.py", line 1025, in load raise pickle.UnpicklingError(UNSAFE_MESSAGE + str(e)) from None _pickle.UnpicklingError: Weights only load failed. Re-running torch.loadwithweights_onlyset toFalsewill likely succeed, but it can result in arbitrary code execution.Do it only if you get the file from a trusted source. WeightsUnpickler error: Unsupported class numpy.core.multiarray.scalar

I also Tried the python scripts

from mocapact import observables
from mocapact.sb3 import utils

expert_path = 'data/experts/CMU_009_12-165-363/eval_rsi/model'
expert = utils.load_policy(expert_path, observables.TIME_INDEX_OBSERVABLES)


from mocapact.envs import tracking
from dm_control.locomotion.tasks.reference_pose import types
dataset = types.ClipCollection(ids=['CMU_009_12'], start_steps=[165], end_steps=[363])
env = tracking.MocapTrackingGymEnv(dataset)
obs, done = env.reset(), False
while not done:
    action, _ = expert.predict(obs, deterministic=True)
    obs, rew, done, _ = env.step(action)
    print(rew)

Still gave that error
image

What might be the cause of this?

edit: I tried setting the weights_only to false and tried running it again. It still showed some error, this time regarding gym. My guess is that since gym is deprecated and the developers have shifted to gymnasium we should also be doing the same. Not sure how to accomplish that though, any idea or suggestions on what might be done now ??

edit 2: Okay I managed to run gym also but When trying to visualize the expert it's throwing errors to open a window

`python mocapact/clip_expert/evaluate.py --act_noise 0. --visualize --termination_error_threshold 1000000 --ghost_offset 1 --always_init_at_clip_start --policy_root data/experts/CMU_009_12-0-198/eval_rsi/model

`
I used the above one to try and visualize, and it gave me an error like
image

When trying the above API of python it just prints the numbers and no window of visualizing is opened

Thank you

MuJoCo version pinning?

Hi folks,

I'm one of the MuJoCo developers. We read your note and are a bit puzzled by it:

Note: All included policies (experts, multi-clip, etc.) will only work with MuJoCo 2.1.5 or earlier. MuJoCo 2.2.0 uses analytic derivatives in place of finite-difference derivatives to determine actuator forces, which effectively changes the transition function of the simulator. Accordingly, MoCapAct installs MuJoCo 2.1.5 and dm_control 1.0.2. The rollout datasets were also generated under MuJoCo 2.1.5.

As far as we know no such change had occurred between 2.1.5 and 2.2.0 (the subsequent release). We did add some analytical derivatives but they are only used by the (non default) implicit integrator. We'd be happy to help you diagnose the cause of the change that you are seeing. In this matter and any other question you might have, please feel free to contact us at github.com/deepmind/mujoco.

Cheers!

Error while trying to run the Multiclip policy

Hi,

I used the multiclip policy provided in the storage explorer (both locomotion and the fulldataset).

I run the following command

python mocapact/distillation/evaluate.py --device cuda:0 --visualize --act_noise 0 --always_init_at_clip_start --ghost_offset 1 --policy_path multiclip_policy/locomotion_dataset/model/model.ckpt --clip_snippets CMU_016_22

This opens up the visualizer but when I hit the play there is no movement and a error pops up.

ERROR:absl:dm_control viewer intercepted an environment error.
Original message: The observation provided is a dict but the obs space is Dict('walker/actuator_activation': Box(-inf, inf, (56,), float32), 'walker/appendages_pos': Box(-inf, inf, (15,), float32), 'walker/body_height': Box(-inf, inf, (1,), float32), 'walker/end_effectors_pos': Box(-inf, inf, (12,), float32), 'walker/gyro_anticlockwise_spin': Box(-inf, inf, (1,), float32), 'walker/gyro_backward_roll': Box(-inf, inf, (1,), float32), 'walker/gyro_control': Box(-inf, inf, (3,), float32), 'walker/gyro_rightward_roll': Box(-inf, inf, (1,), float32), 'walker/head_height': Box(-inf, inf, (1,), float32), 'walker/joints_pos': Box(-inf, inf, (56,), float32), 'walker/joints_vel': Box(-inf, inf, (56,), float32), 'walker/joints_vel_control': Box(-inf, inf, (56,), float32), 'walker/orientation': Box(-inf, inf, (9,), float32), 'walker/position': Box(-inf, inf, (3,), float32), 'walker/reference_appendages_pos': Box(-inf, inf, (75,), float32), 'walker/reference_ego_bodies_quats': Box(-inf, inf, (620,), float32), 'walker/reference_rel_bodies_pos_global': Box(-inf, inf, (465,), float32), 'walker/reference_rel_bodies_pos_local': Box(-inf, inf, (465,), float32), 'walker/reference_rel_bodies_quats': Box(-inf, inf, (620,), float32), 'walker/reference_rel_joints': Box(-inf, inf, (280,), float32), 'walker/reference_rel_root_pos_local': Box(-inf, inf, (15,), float32), 'walker/reference_rel_root_quat': Box(-inf, inf, (20,), float32), 'walker/sensors_accelerometer': Box(-inf, inf, (3,), float32), 'walker/sensors_gyro': Box(-inf, inf, (3,), float32), 'walker/sensors_torque': Box(-inf, inf, (6,), float32), 'walker/sensors_touch': Box(-inf, inf, (10,), float32), 'walker/sensors_velocimeter': Box(-inf, inf, (3,), float32), 'walker/time_in_clip': Box(-inf, inf, (1,), float32), 'walker/torso_xvel': Box(-inf, inf, (1,), float32), 'walker/torso_yvel': Box(-inf, inf, (1,), float32), 'walker/veloc_forward': Box(-inf, inf, (1,), float32), 'walker/veloc_strafe': Box(-inf, inf, (1,), float32), 'walker/veloc_up': Box(-inf, inf, (1,), float32), 'walker/velocimeter_control': Box(-inf, inf, (3,), float32), 'walker/world_zaxis': Box(-inf, inf, (3,), float32))
dm_control viewer intercepted an environment error.
Original message: The observation provided is a dict but the obs space is Dict('walker/actuator_activation': Box(-inf, inf, (56,), float32), 'walker/appendages_pos': Box(-inf, inf, (15,), float32), 'walker/body_height': Box(-inf, inf, (1,), float32), 'walker/end_effectors_pos': Box(-inf, inf, (12,), float32), 'walker/gyro_anticlockwise_spin': Box(-inf, inf, (1,), float32), 'walker/gyro_backward_roll': Box(-inf, inf, (1,), float32), 'walker/gyro_control': Box(-inf, inf, (3,), float32), 'walker/gyro_rightward_roll': Box(-inf, inf, (1,), float32), 'walker/head_height': Box(-inf, inf, (1,), float32), 'walker/joints_pos': Box(-inf, inf, (56,), float32), 'walker/joints_vel': Box(-inf, inf, (56,), float32), 'walker/joints_vel_control': Box(-inf, inf, (56,), float32), 'walker/orientation': Box(-inf, inf, (9,), float32), 'walker/position': Box(-inf, inf, (3,), float32), 'walker/reference_appendages_pos': Box(-inf, inf, (75,), float32), 'walker/reference_ego_bodies_quats': Box(-inf, inf, (620,), float32), 'walker/reference_rel_bodies_pos_global': Box(-inf, inf, (465,), float32), 'walker/reference_rel_bodies_pos_local': Box(-inf, inf, (465,), float32), 'walker/reference_rel_bodies_quats': Box(-inf, inf, (620,), float32), 'walker/reference_rel_joints': Box(-inf, inf, (280,), float32), 'walker/reference_rel_root_pos_local': Box(-inf, inf, (15,), float32), 'walker/reference_rel_root_quat': Box(-inf, inf, (20,), float32), 'walker/sensors_accelerometer': Box(-inf, inf, (3,), float32), 'walker/sensors_gyro': Box(-inf, inf, (3,), float32), 'walker/sensors_torque': Box(-inf, inf, (6,), float32), 'walker/sensors_touch': Box(-inf, inf, (10,), float32), 'walker/sensors_velocimeter': Box(-inf, inf, (3,), float32), 'walker/time_in_clip': Box(-inf, inf, (1,), float32), 'walker/torso_xvel': Box(-inf, inf, (1,), float32), 'walker/torso_yvel': Box(-inf, inf, (1,), float32), 'walker/veloc_forward': Box(-inf, inf, (1,), float32), 'walker/veloc_strafe': Box(-inf, inf, (1,), float32), 'walker/veloc_up': Box(-inf, inf, (1,), float32), 'walker/velocimeter_control': Box(-inf, inf, (3,), float32), 'walker/world_zaxis': Box(-inf, inf, (3,), float32))
Traceback:
  File "/home/rakesh/anaconda3/envs/newenv/lib/python3.10/site-packages/dm_control/viewer/runtime.py", line 251, in _step
    action = self._policy(self._time_step)
  File "/home/rakesh/anaconda3/envs/newenv/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/rakesh/Desktop/project/MoCapAct/main.py", line 123, in policy_fn
    action, state = policy.predict(env.get_observation(time_step), state, deterministic= deterministic)
  File "/home/rakesh/Desktop/project/MoCapAct/mocapact/distillation/model.py", line 194, in predict
    observation, vectorized_env = self.obs_to_tensor(observation)
  File "/home/rakesh/anaconda3/envs/newenv/lib/python3.10/site-packages/stable_baselines3/common/policies.py", line 247, in obs_to_tensor
    assert isinstance(

I feel there is a mismatch in the observations cause the first line says that it expect a dict but given obs space is ....

train models?

This is very interesting work. How can we train our own robot models?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.