Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
@@ -21,7 +21,7 @@ model-index:
|
|
21 |
type: OpenAI/Gym/MuJoCo-HalfCheetah-v3
|
22 |
metrics:
|
23 |
- type: mean_reward
|
24 |
-
value:
|
25 |
name: mean_reward
|
26 |
---
|
27 |
|
@@ -53,6 +53,7 @@ wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz -O mujoco.tar.gz
|
|
53 |
tar -xf mujoco.tar.gz -C ~/.mujoco
|
54 |
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mjpro210/bin:~/.mujoco/mujoco210/bin" >> ~/.bashrc
|
55 |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mjpro210/bin:~/.mujoco/mujoco210/bin
|
|
|
56 |
pip3 install DI-engine[common_env]
|
57 |
|
58 |
```
|
@@ -69,21 +70,7 @@ python3 -u run.py
|
|
69 |
```
|
70 |
**run.py**
|
71 |
```python
|
72 |
-
|
73 |
-
from ding.config import Config
|
74 |
-
from easydict import EasyDict
|
75 |
-
import torch
|
76 |
-
|
77 |
-
# Pull model from files which are git cloned from huggingface
|
78 |
-
policy_state_dict = torch.load("pytorch_model.bin", map_location=torch.device("cpu"))
|
79 |
-
cfg = EasyDict(Config.file_to_dict("policy_config.py"))
|
80 |
-
# Instantiate the agent
|
81 |
-
agent = SACAgent(env="HalfCheetah", exp_name="HalfCheetah-v3-SAC", cfg=cfg.exp_config, policy_state_dict=policy_state_dict)
|
82 |
-
# Continue training
|
83 |
-
agent.train(step=5000)
|
84 |
-
# Render the new agent performance
|
85 |
-
agent.deploy(enable_save_replay=True)
|
86 |
-
|
87 |
```
|
88 |
</details>
|
89 |
|
@@ -98,18 +85,7 @@ python3 -u run.py
|
|
98 |
```
|
99 |
**run.py**
|
100 |
```python
|
101 |
-
|
102 |
-
from huggingface_ding import pull_model_from_hub
|
103 |
-
|
104 |
-
# Pull model from Hugggingface hub
|
105 |
-
policy_state_dict, cfg = pull_model_from_hub(repo_id="OpenDILabCommunity/HalfCheetah-v3-SAC")
|
106 |
-
# Instantiate the agent
|
107 |
-
agent = SACAgent(env="HalfCheetah", exp_name="HalfCheetah-v3-SAC", cfg=cfg.exp_config, policy_state_dict=policy_state_dict)
|
108 |
-
# Continue training
|
109 |
-
agent.train(step=5000)
|
110 |
-
# Render the new agent performance
|
111 |
-
agent.deploy(enable_save_replay=True)
|
112 |
-
|
113 |
```
|
114 |
</details>
|
115 |
|
@@ -126,52 +102,7 @@ python3 -u train.py
|
|
126 |
```
|
127 |
**train.py**
|
128 |
```python
|
129 |
-
|
130 |
-
from huggingface_ding import push_model_to_hub
|
131 |
-
|
132 |
-
# Instantiate the agent
|
133 |
-
agent = SACAgent(env="HalfCheetah", exp_name="HalfCheetah-v3-SAC")
|
134 |
-
# Train the agent
|
135 |
-
return_ = agent.train(step=int(5000000))
|
136 |
-
# Push model to huggingface hub
|
137 |
-
push_model_to_hub(
|
138 |
-
agent=agent.best,
|
139 |
-
env_name="OpenAI/Gym/MuJoCo",
|
140 |
-
task_name="HalfCheetah-v3",
|
141 |
-
algo_name="SAC",
|
142 |
-
wandb_url=return_.wandb_url,
|
143 |
-
github_repo_url="https://github.com/opendilab/DI-engine",
|
144 |
-
github_doc_model_url="https://di-engine-docs.readthedocs.io/en/latest/12_policies/sac.html",
|
145 |
-
github_doc_env_url="https://di-engine-docs.readthedocs.io/en/latest/13_envs/mujoco.html",
|
146 |
-
installation_guide='''
|
147 |
-
sudo apt update -y \
|
148 |
-
&& sudo apt install -y \
|
149 |
-
build-essential \
|
150 |
-
libgl1-mesa-dev \
|
151 |
-
libgl1-mesa-glx \
|
152 |
-
libglew-dev \
|
153 |
-
libosmesa6-dev \
|
154 |
-
libglfw3 \
|
155 |
-
libglfw3-dev \
|
156 |
-
libsdl2-dev \
|
157 |
-
libsdl2-image-dev \
|
158 |
-
libglm-dev \
|
159 |
-
libfreetype6-dev \
|
160 |
-
patchelf
|
161 |
-
|
162 |
-
mkdir -p ~/.mujoco
|
163 |
-
wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz -O mujoco.tar.gz
|
164 |
-
tar -xf mujoco.tar.gz -C ~/.mujoco
|
165 |
-
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mjpro210/bin:~/.mujoco/mujoco210/bin" >> ~/.bashrc
|
166 |
-
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mjpro210/bin:~/.mujoco/mujoco210/bin
|
167 |
-
pip3 install DI-engine[common_env]
|
168 |
-
''',
|
169 |
-
usage_file_by_git_clone="./sac/halfcheetah_sac_deploy.py",
|
170 |
-
usage_file_by_huggingface_ding="./sac/halfcheetah_sac_download.py",
|
171 |
-
train_file="./sac/halfcheetah_sac.py",
|
172 |
-
repo_id="OpenDILabCommunity/HalfCheetah-v3-SAC"
|
173 |
-
)
|
174 |
-
|
175 |
```
|
176 |
</details>
|
177 |
|
@@ -194,16 +125,11 @@ exp_config = {
|
|
194 |
'cfg_type': 'BaseEnvManagerDict'
|
195 |
},
|
196 |
'stop_value': 12000,
|
|
|
197 |
'env_id': 'HalfCheetah-v3',
|
198 |
-
'norm_obs': {
|
199 |
-
'use_norm': False
|
200 |
-
},
|
201 |
-
'norm_reward': {
|
202 |
-
'use_norm': False
|
203 |
-
},
|
204 |
'collector_env_num': 1,
|
205 |
'evaluator_env_num': 8,
|
206 |
-
'
|
207 |
},
|
208 |
'policy': {
|
209 |
'model': {
|
@@ -257,9 +183,10 @@ exp_config = {
|
|
257 |
'render_freq': -1,
|
258 |
'mode': 'train_iter'
|
259 |
},
|
|
|
260 |
'cfg_type': 'InteractionSerialEvaluatorDict',
|
261 |
-
'
|
262 |
-
'
|
263 |
}
|
264 |
},
|
265 |
'other': {
|
@@ -268,7 +195,7 @@ exp_config = {
|
|
268 |
}
|
269 |
},
|
270 |
'on_policy': False,
|
271 |
-
'cuda':
|
272 |
'multi_gpu': False,
|
273 |
'bp_update_sync': True,
|
274 |
'traj_len_inf': False,
|
@@ -297,7 +224,7 @@ exp_config = {
|
|
297 |
|
298 |
**Training Procedure**
|
299 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
300 |
-
- **Weights & Biases (wandb):** [monitor link](https://wandb.ai/
|
301 |
|
302 |
## Model Information
|
303 |
<!-- Provide the basic links for the model. -->
|
@@ -306,14 +233,14 @@ exp_config = {
|
|
306 |
- **Configuration:** [config link](https://huggingface.co/OpenDILabCommunity/HalfCheetah-v3-SAC/blob/main/policy_config.py)
|
307 |
- **Demo:** [video](https://huggingface.co/OpenDILabCommunity/HalfCheetah-v3-SAC/blob/main/replay.mp4)
|
308 |
<!-- Provide the size information for the model. -->
|
309 |
-
- **Parameters total size:**
|
310 |
-
- **Last Update Date:** 2023-
|
311 |
|
312 |
## Environments
|
313 |
<!-- Address questions around what environment the model is intended to be trained and deployed at, including the necessary information needed to be provided for future users. -->
|
314 |
- **Benchmark:** OpenAI/Gym/MuJoCo
|
315 |
- **Task:** HalfCheetah-v3
|
316 |
- **Gym version:** 0.25.1
|
317 |
-
- **DI-engine version:** v0.4.
|
318 |
-
- **PyTorch version:**
|
319 |
- **Doc**: [DI-engine-docs Environments link](https://di-engine-docs.readthedocs.io/en/latest/13_envs/mujoco.html)
|
|
|
21 |
type: OpenAI/Gym/MuJoCo-HalfCheetah-v3
|
22 |
metrics:
|
23 |
- type: mean_reward
|
24 |
+
value: 11902.91 +/- 87.23
|
25 |
name: mean_reward
|
26 |
---
|
27 |
|
|
|
53 |
tar -xf mujoco.tar.gz -C ~/.mujoco
|
54 |
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mjpro210/bin:~/.mujoco/mujoco210/bin" >> ~/.bashrc
|
55 |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mjpro210/bin:~/.mujoco/mujoco210/bin
|
56 |
+
pip3 install "cython<3"
|
57 |
pip3 install DI-engine[common_env]
|
58 |
|
59 |
```
|
|
|
70 |
```
|
71 |
**run.py**
|
72 |
```python
|
73 |
+
# [More Information Needed]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
```
|
75 |
</details>
|
76 |
|
|
|
85 |
```
|
86 |
**run.py**
|
87 |
```python
|
88 |
+
# [More Information Needed]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
```
|
90 |
</details>
|
91 |
|
|
|
102 |
```
|
103 |
**train.py**
|
104 |
```python
|
105 |
+
# [More Information Needed]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
```
|
107 |
</details>
|
108 |
|
|
|
125 |
'cfg_type': 'BaseEnvManagerDict'
|
126 |
},
|
127 |
'stop_value': 12000,
|
128 |
+
'n_evaluator_episode': 8,
|
129 |
'env_id': 'HalfCheetah-v3',
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
'collector_env_num': 1,
|
131 |
'evaluator_env_num': 8,
|
132 |
+
'env_wrapper': 'mujoco_default'
|
133 |
},
|
134 |
'policy': {
|
135 |
'model': {
|
|
|
183 |
'render_freq': -1,
|
184 |
'mode': 'train_iter'
|
185 |
},
|
186 |
+
'figure_path': None,
|
187 |
'cfg_type': 'InteractionSerialEvaluatorDict',
|
188 |
+
'stop_value': 12000,
|
189 |
+
'n_episode': 8
|
190 |
}
|
191 |
},
|
192 |
'other': {
|
|
|
195 |
}
|
196 |
},
|
197 |
'on_policy': False,
|
198 |
+
'cuda': True,
|
199 |
'multi_gpu': False,
|
200 |
'bp_update_sync': True,
|
201 |
'traj_len_inf': False,
|
|
|
224 |
|
225 |
**Training Procedure**
|
226 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
227 |
+
- **Weights & Biases (wandb):** [monitor link](https://wandb.ai/zjowowen/HalfCheetah-v3-SAC)
|
228 |
|
229 |
## Model Information
|
230 |
<!-- Provide the basic links for the model. -->
|
|
|
233 |
- **Configuration:** [config link](https://huggingface.co/OpenDILabCommunity/HalfCheetah-v3-SAC/blob/main/policy_config.py)
|
234 |
- **Demo:** [video](https://huggingface.co/OpenDILabCommunity/HalfCheetah-v3-SAC/blob/main/replay.mp4)
|
235 |
<!-- Provide the size information for the model. -->
|
236 |
+
- **Parameters total size:** 1702.11 KB
|
237 |
+
- **Last Update Date:** 2023-09-19
|
238 |
|
239 |
## Environments
|
240 |
<!-- Address questions around what environment the model is intended to be trained and deployed at, including the necessary information needed to be provided for future users. -->
|
241 |
- **Benchmark:** OpenAI/Gym/MuJoCo
|
242 |
- **Task:** HalfCheetah-v3
|
243 |
- **Gym version:** 0.25.1
|
244 |
+
- **DI-engine version:** v0.4.9
|
245 |
+
- **PyTorch version:** 2.0.1+cu117
|
246 |
- **Doc**: [DI-engine-docs Environments link](https://di-engine-docs.readthedocs.io/en/latest/13_envs/mujoco.html)
|