File size: 5,091 Bytes
825cff4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | # Installation
## Requirements
- Mac OS X or Linux machine
- Python >= 3.6 (recommended 3.8.0)
- [conda](https://www.anaconda.com/products/individual)
- [virtualenv](https://virtualenv.pypa.io/en/latest/) is also an acceptable alternative, but we assume you have conda installed in our examples below
## Install robomimic
<div class="admonition note">
<p class="admonition-title">1. Create and activate conda environment</p>
```sh
$ conda create -n robomimic_venv python=3.8.0
$ conda activate robomimic_venv
```
</div>
<div class="admonition note">
<p class="admonition-title">2. Install PyTorch</p>
[PyTorch](https://pytorch.org/) reference
<details>
<summary><b>Option 1: Mac</b></summary>
<p>
```sh
# Can change pytorch, torchvision versions
# We don't install cudatoolkit since Mac does not have NVIDIA GPU
$ conda install pytorch==2.0.0 torchvision==0.15.1 -c pytorch
```
</p>
</details>
<details>
<summary><b>Option 2: Linux</b></summary>
<p>
```sh
# Can change pytorch, torchvision versions
$ conda install pytorch==2.0.0 torchvision==0.15.1 -c pytorch
```
</p>
</details>
</div>
<div class="admonition note">
<p class="admonition-title">3. Install robomimic</p>
<details>
<summary><b>Option 1: Install from source <i>(recommended)</i></b></summary>
<p>
```sh
$ cd <PATH_TO_YOUR_INSTALL_DIRECTORY>
$ git clone https://github.com/ARISE-Initiative/robomimic.git
$ cd robomimic
$ pip install -e .
```
</p>
</details>
<details>
<summary><b>Option 2: Install via pip</b></summary>
<p>
```sh
$ pip install robomimic
```
</p>
</details>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning! Additional dependencies might be required</p>
This is all you need for using the suite of algorithms and utilities packaged with robomimic. However, to use our demonstration datasets, you may need additional dependencies. Please see the [datasets page](../datasets/overview.html) for more information on downloading datasets and reproducing experiments, and see [the simulators section below](installation.html#install-simulators).
</div>
# Optional Installations
## Downloading datasets and reproducing experiments
See the [datasets page](../datasets/overview.html) for more information on downloading datasets and reproducing experiments.
## Install simulators
If you would like to run robomimic examples and work with released datasets, please install the following simulators:
<details>
<summary><b>robosuite</b></summary>
<p>
Required for running most robomimic examples and released datasets. Compatible with robosuite v1.2+. Install via:
```sh
# From source (recommended)
$ cd <PATH_TO_INSTALL_DIR>
$ git clone https://github.com/ARISE-Initiative/robosuite.git
$ cd robosuite
$ pip install -r requirements.txt
OR
# Via pip
$ pip install robosuite
```
**(Optional)** to use our released datasets and reproduce our experiments, switch to the `v1.5.1` branch (requires installing robosuite from source):
```sh
git checkout v1.5.1
```
<!-- <div class="admonition warning">
<p class="admonition-title">mujoco-py dependency!</p>
Robosuite requires [mujoco-py](https://github.com/openai/mujoco-py). If you are on an Ubuntu machine with a GPU, you should make sure that the `GPU` version of `mujoco-py` gets built, so that image rendering is fast (crucial for working with image datasets!).
An easy way to ensure this is to clone the repository, change [this line](https://github.com/openai/mujoco-py/blob/4830435a169c1f3e3b5f9b58a7c3d9c39bdf4acb/mujoco_py/builder.py#L74) to `Builder = LinuxGPUExtensionBuilder`, and install from source by running `pip install -e .` in the `mujoco-py` root directory.
</div> -->
</p>
</details>
<details>
<summary><b>D4RL</b></summary>
<p>
Useful for running some of our algorithms on the [D4RL](https://arxiv.org/abs/2004.07219) datasets.
Install via the instructions [here](https://github.com/rail-berkeley/d4rl).
</p>
</details>
## Test your installation
This assumes you have installed robomimic from source.
Run a quick debugging (dummy) training loop to make sure robomimic is installed correctly:
```sh
$ cd <PATH_TO_ROBOMIMIC_INSTALL_DIR>
$ python examples/train_bc_rnn.py --debug
```
Run a much more thorough test of several algorithms and scripts (**Warning: this script may take several minutes to finish!**):
```sh
$ cd <PATH_TO_ROBOMIMIC_INSTALL_DIR>/tests
$ bash test.sh
```
To run some easy examples, see the [Getting Started](./getting_started.html) section.
## Install documentation dependencies
If you plan to contribute to the repository and add new features, you must install the additional requirements required to build the documentation locally:
```sh
$ pip install -r requirements-docs.txt
```
You can test generating the documentation and viewing it locally in a web browser:
```sh
$ cd <PATH_TO_ROBOMIMIC_INSTALL_DIR>/docs
$ make clean
$ make apidoc
$ make html
$ make prep
$ cp -r images _build/html/
```
There should be a generated `_build` folder - navigate to `_build/html/` and open `index.html` in a web browser to view the documentation. |