Commit
·
294a607
1
Parent(s):
16c9742
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- .summary/0/events.out.tfevents.1688738214.qgallouedec-MS-7C84 +3 -0
- README.md +56 -0
- checkpoint_p0/best_000030592_15663104_reward_4542.259.pth +3 -0
- checkpoint_p0/checkpoint_000044608_22839296.pth +3 -0
- checkpoint_p0/checkpoint_000044704_22888448.pth +3 -0
- config.json +134 -0
- git.diff +347 -0
- replay.mp4 +3 -0
- sf_log.txt +0 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
replay.mp4 filter=lfs diff=lfs merge=lfs -text
|
.summary/0/events.out.tfevents.1688738214.qgallouedec-MS-7C84
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a3195cd70b710fa1bd595bed11f7260f04bbf548d71304765e81affac18ac41d
|
3 |
+
size 1502577
|
README.md
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: sample-factory
|
3 |
+
tags:
|
4 |
+
- deep-reinforcement-learning
|
5 |
+
- reinforcement-learning
|
6 |
+
- sample-factory
|
7 |
+
model-index:
|
8 |
+
- name: APPO
|
9 |
+
results:
|
10 |
+
- task:
|
11 |
+
type: reinforcement-learning
|
12 |
+
name: reinforcement-learning
|
13 |
+
dataset:
|
14 |
+
name: basketball-v2
|
15 |
+
type: basketball-v2
|
16 |
+
metrics:
|
17 |
+
- type: mean_reward
|
18 |
+
value: 4555.14 +/- 18.34
|
19 |
+
name: mean_reward
|
20 |
+
verified: false
|
21 |
+
---
|
22 |
+
|
23 |
+
A(n) **APPO** model trained on the **basketball-v2** environment.
|
24 |
+
|
25 |
+
This model was trained using Sample-Factory 2.0: https://github.com/alex-petrenko/sample-factory.
|
26 |
+
Documentation for how to use Sample-Factory can be found at https://www.samplefactory.dev/
|
27 |
+
|
28 |
+
|
29 |
+
## Downloading the model
|
30 |
+
|
31 |
+
After installing Sample-Factory, download the model with:
|
32 |
+
```
|
33 |
+
python -m sample_factory.huggingface.load_from_hub -r qgallouedec/basketball-v2
|
34 |
+
```
|
35 |
+
|
36 |
+
|
37 |
+
## Using the model
|
38 |
+
|
39 |
+
To run the model after download, use the `enjoy` script corresponding to this environment:
|
40 |
+
```
|
41 |
+
python -m enjoy --algo=APPO --env=basketball-v2 --train_dir=./train_dir --experiment=basketball-v2
|
42 |
+
```
|
43 |
+
|
44 |
+
|
45 |
+
You can also upload models to the Hugging Face Hub using the same script with the `--push_to_hub` flag.
|
46 |
+
See https://www.samplefactory.dev/10-huggingface/huggingface/ for more details
|
47 |
+
|
48 |
+
## Training with this model
|
49 |
+
|
50 |
+
To continue training with this model, use the `train` script corresponding to this environment:
|
51 |
+
```
|
52 |
+
python -m train --algo=APPO --env=basketball-v2 --train_dir=./train_dir --experiment=basketball-v2 --restart_behavior=resume --train_for_env_steps=10000000000
|
53 |
+
```
|
54 |
+
|
55 |
+
Note, you may have to adjust `--train_for_env_steps` to a suitably high number as the experiment will resume at the number of steps it concluded at.
|
56 |
+
|
checkpoint_p0/best_000030592_15663104_reward_4542.259.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:861864470a9854bb6536f529d547cc0ad40d6fa944ed4b01e47fe341b7445aa3
|
3 |
+
size 98239
|
checkpoint_p0/checkpoint_000044608_22839296.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9dfe54c74cafc6368de0770feace10e00e1f22d6c69adff5df24afe417697d32
|
3 |
+
size 98567
|
checkpoint_p0/checkpoint_000044704_22888448.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8f3e6c719a6c770413e7938fff9d2fc3d98338078de6fb2354671a0e64b6819a
|
3 |
+
size 98567
|
config.json
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"help": false,
|
3 |
+
"algo": "APPO",
|
4 |
+
"env": "basketball-v2",
|
5 |
+
"experiment": "basketball-v2",
|
6 |
+
"train_dir": "/home/qgallouedec/data/gia/data/envs/metaworld/train_dir",
|
7 |
+
"restart_behavior": "restart",
|
8 |
+
"device": "cpu",
|
9 |
+
"seed": null,
|
10 |
+
"num_policies": 1,
|
11 |
+
"async_rl": false,
|
12 |
+
"serial_mode": false,
|
13 |
+
"batched_sampling": false,
|
14 |
+
"num_batches_to_accumulate": 2,
|
15 |
+
"worker_num_splits": 2,
|
16 |
+
"policy_workers_per_policy": 1,
|
17 |
+
"max_policy_lag": 1000,
|
18 |
+
"num_workers": 8,
|
19 |
+
"num_envs_per_worker": 8,
|
20 |
+
"batch_size": 1024,
|
21 |
+
"num_batches_per_epoch": 4,
|
22 |
+
"num_epochs": 2,
|
23 |
+
"rollout": 64,
|
24 |
+
"recurrence": 1,
|
25 |
+
"shuffle_minibatches": false,
|
26 |
+
"gamma": 0.99,
|
27 |
+
"reward_scale": 0.1,
|
28 |
+
"reward_clip": 1000.0,
|
29 |
+
"value_bootstrap": true,
|
30 |
+
"normalize_returns": true,
|
31 |
+
"exploration_loss_coeff": 0.0,
|
32 |
+
"value_loss_coeff": 1.3,
|
33 |
+
"kl_loss_coeff": 0.1,
|
34 |
+
"exploration_loss": "entropy",
|
35 |
+
"gae_lambda": 0.95,
|
36 |
+
"ppo_clip_ratio": 0.2,
|
37 |
+
"ppo_clip_value": 1.0,
|
38 |
+
"with_vtrace": false,
|
39 |
+
"vtrace_rho": 1.0,
|
40 |
+
"vtrace_c": 1.0,
|
41 |
+
"optimizer": "adam",
|
42 |
+
"adam_eps": 1e-06,
|
43 |
+
"adam_beta1": 0.9,
|
44 |
+
"adam_beta2": 0.999,
|
45 |
+
"max_grad_norm": 3.5,
|
46 |
+
"learning_rate": 0.00295,
|
47 |
+
"lr_schedule": "linear_decay",
|
48 |
+
"lr_schedule_kl_threshold": 0.008,
|
49 |
+
"lr_adaptive_min": 1e-06,
|
50 |
+
"lr_adaptive_max": 0.01,
|
51 |
+
"obs_subtract_mean": 0.0,
|
52 |
+
"obs_scale": 1.0,
|
53 |
+
"normalize_input": true,
|
54 |
+
"normalize_input_keys": null,
|
55 |
+
"decorrelate_experience_max_seconds": 0,
|
56 |
+
"decorrelate_envs_on_one_worker": true,
|
57 |
+
"actor_worker_gpus": [],
|
58 |
+
"set_workers_cpu_affinity": true,
|
59 |
+
"force_envs_single_thread": false,
|
60 |
+
"default_niceness": 0,
|
61 |
+
"log_to_file": true,
|
62 |
+
"experiment_summaries_interval": 3,
|
63 |
+
"flush_summaries_interval": 30,
|
64 |
+
"stats_avg": 100,
|
65 |
+
"summaries_use_frameskip": true,
|
66 |
+
"heartbeat_interval": 20,
|
67 |
+
"heartbeat_reporting_interval": 180,
|
68 |
+
"train_for_env_steps": 100000000,
|
69 |
+
"train_for_seconds": 10000000000,
|
70 |
+
"save_every_sec": 15,
|
71 |
+
"keep_checkpoints": 2,
|
72 |
+
"load_checkpoint_kind": "latest",
|
73 |
+
"save_milestones_sec": -1,
|
74 |
+
"save_best_every_sec": 5,
|
75 |
+
"save_best_metric": "reward",
|
76 |
+
"save_best_after": 100000,
|
77 |
+
"benchmark": false,
|
78 |
+
"encoder_mlp_layers": [
|
79 |
+
64,
|
80 |
+
64
|
81 |
+
],
|
82 |
+
"encoder_conv_architecture": "convnet_simple",
|
83 |
+
"encoder_conv_mlp_layers": [
|
84 |
+
512
|
85 |
+
],
|
86 |
+
"use_rnn": false,
|
87 |
+
"rnn_size": 512,
|
88 |
+
"rnn_type": "gru",
|
89 |
+
"rnn_num_layers": 1,
|
90 |
+
"decoder_mlp_layers": [],
|
91 |
+
"nonlinearity": "tanh",
|
92 |
+
"policy_initialization": "torch_default",
|
93 |
+
"policy_init_gain": 1.0,
|
94 |
+
"actor_critic_share_weights": true,
|
95 |
+
"adaptive_stddev": false,
|
96 |
+
"continuous_tanh_scale": 0.0,
|
97 |
+
"initial_stddev": 1.0,
|
98 |
+
"use_env_info_cache": false,
|
99 |
+
"env_gpu_actions": false,
|
100 |
+
"env_gpu_observations": true,
|
101 |
+
"env_frameskip": 1,
|
102 |
+
"env_framestack": 1,
|
103 |
+
"pixel_format": "CHW",
|
104 |
+
"use_record_episode_statistics": false,
|
105 |
+
"with_wandb": true,
|
106 |
+
"wandb_user": "qgallouedec",
|
107 |
+
"wandb_project": "sample_facotry_metaworld",
|
108 |
+
"wandb_group": null,
|
109 |
+
"wandb_job_type": "SF",
|
110 |
+
"wandb_tags": [],
|
111 |
+
"with_pbt": false,
|
112 |
+
"pbt_mix_policies_in_one_env": true,
|
113 |
+
"pbt_period_env_steps": 5000000,
|
114 |
+
"pbt_start_mutation": 20000000,
|
115 |
+
"pbt_replace_fraction": 0.3,
|
116 |
+
"pbt_mutation_rate": 0.15,
|
117 |
+
"pbt_replace_reward_gap": 0.1,
|
118 |
+
"pbt_replace_reward_gap_absolute": 1e-06,
|
119 |
+
"pbt_optimize_gamma": false,
|
120 |
+
"pbt_target_objective": "true_objective",
|
121 |
+
"pbt_perturb_min": 1.1,
|
122 |
+
"pbt_perturb_max": 1.5,
|
123 |
+
"command_line": "--env basketball-v2 --experiment basketball-v2 --with_wandb True --wandb_user qgallouedec --wandb_project sample_facotry_metaworld",
|
124 |
+
"cli_args": {
|
125 |
+
"env": "basketball-v2",
|
126 |
+
"experiment": "basketball-v2",
|
127 |
+
"with_wandb": true,
|
128 |
+
"wandb_user": "qgallouedec",
|
129 |
+
"wandb_project": "sample_facotry_metaworld"
|
130 |
+
},
|
131 |
+
"git_hash": "aed90d9e164e44f91bab1d70c09fac4dee064031",
|
132 |
+
"git_repo_name": "https://github.com/huggingface/gia",
|
133 |
+
"wandb_unique_id": "basketball-v2_20230707_155648_448084"
|
134 |
+
}
|
git.diff
ADDED
@@ -0,0 +1,347 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
diff --git a/data/envs/metaworld/generate_dataset.py b/data/envs/metaworld/generate_dataset.py
|
2 |
+
index e21b237..c2b1907 100644
|
3 |
+
--- a/data/envs/metaworld/generate_dataset.py
|
4 |
+
+++ b/data/envs/metaworld/generate_dataset.py
|
5 |
+
@@ -142,7 +142,8 @@ def create_dataset(cfg: Config, dataset_size: int = 100_000, split: str = "train
|
6 |
+
|
7 |
+
# Actions shape should be [num_agents, num_actions] even if it's [1, 1]
|
8 |
+
actions = preprocess_actions(env_info, actions)
|
9 |
+
-
|
10 |
+
+ # Clamp actions to be in the range of the action space
|
11 |
+
+ actions = np.clip(actions, env.action_space.low, env.action_space.high)
|
12 |
+
rnn_states = policy_outputs["new_rnn_states"]
|
13 |
+
dataset["continuous_observations"][-1].append(observations["obs"].cpu().numpy()[0])
|
14 |
+
dataset["continuous_actions"][-1].append(actions[0])
|
15 |
+
diff --git a/data/envs/metaworld/generate_dataset_all.sh b/data/envs/metaworld/generate_dataset_all.sh
|
16 |
+
index cfdae2f..5db8c4b 100755
|
17 |
+
--- a/data/envs/metaworld/generate_dataset_all.sh
|
18 |
+
+++ b/data/envs/metaworld/generate_dataset_all.sh
|
19 |
+
@@ -2,58 +2,58 @@
|
20 |
+
|
21 |
+
ENVS=(
|
22 |
+
assembly
|
23 |
+
- basketball
|
24 |
+
- bin-picking
|
25 |
+
- box-close
|
26 |
+
- button-press-topdown
|
27 |
+
- button-press-topdown-wall
|
28 |
+
- button-press
|
29 |
+
- button-press-wall
|
30 |
+
- coffee-button
|
31 |
+
- coffee-pull
|
32 |
+
- coffee-push
|
33 |
+
- dial-turn
|
34 |
+
- disassemble
|
35 |
+
- door-close
|
36 |
+
- door-lock
|
37 |
+
- door-open
|
38 |
+
- door-unlock
|
39 |
+
- drawer-close
|
40 |
+
- drawer-open
|
41 |
+
- faucet-close
|
42 |
+
- faucet-open
|
43 |
+
- hammer
|
44 |
+
- hand-insert
|
45 |
+
- handle-press-side
|
46 |
+
- handle-press
|
47 |
+
- handle-pull-side
|
48 |
+
- handle-pull
|
49 |
+
- lever-pull
|
50 |
+
- peg-insert-side
|
51 |
+
- peg-unplug-side
|
52 |
+
- pick-out-of-hole
|
53 |
+
- pick-place
|
54 |
+
- pick-place-wall
|
55 |
+
- plate-slide-back-side
|
56 |
+
- plate-slide-back
|
57 |
+
- plate-slide-side
|
58 |
+
- plate-slide
|
59 |
+
- push-back
|
60 |
+
- push
|
61 |
+
- push-wall
|
62 |
+
- reach
|
63 |
+
- reach-wall
|
64 |
+
- shelf-place
|
65 |
+
- soccer
|
66 |
+
- stick-pull
|
67 |
+
- stick-push
|
68 |
+
- sweep-into
|
69 |
+
- sweep
|
70 |
+
- window-close
|
71 |
+
- window-open
|
72 |
+
+ # basketball
|
73 |
+
+ # bin-picking
|
74 |
+
+ # box-close
|
75 |
+
+ # button-press-topdown
|
76 |
+
+ # button-press-topdown-wall
|
77 |
+
+ # button-press
|
78 |
+
+ # button-press-wall
|
79 |
+
+ # coffee-button
|
80 |
+
+ # coffee-pull
|
81 |
+
+ # coffee-push
|
82 |
+
+ # dial-turn
|
83 |
+
+ # disassemble
|
84 |
+
+ # door-close
|
85 |
+
+ # door-lock
|
86 |
+
+ # door-open
|
87 |
+
+ # door-unlock
|
88 |
+
+ # drawer-close
|
89 |
+
+ # drawer-open
|
90 |
+
+ # faucet-close
|
91 |
+
+ # faucet-open
|
92 |
+
+ # hammer
|
93 |
+
+ # hand-insert
|
94 |
+
+ # handle-press-side
|
95 |
+
+ # handle-press
|
96 |
+
+ # handle-pull-side
|
97 |
+
+ # handle-pull
|
98 |
+
+ # lever-pull
|
99 |
+
+ # peg-insert-side
|
100 |
+
+ # peg-unplug-side
|
101 |
+
+ # pick-out-of-hole
|
102 |
+
+ # pick-place
|
103 |
+
+ # pick-place-wall
|
104 |
+
+ # plate-slide-back-side
|
105 |
+
+ # plate-slide-back
|
106 |
+
+ # plate-slide-side
|
107 |
+
+ # plate-slide
|
108 |
+
+ # push-back
|
109 |
+
+ # push
|
110 |
+
+ # push-wall
|
111 |
+
+ # reach
|
112 |
+
+ # reach-wall
|
113 |
+
+ # shelf-place
|
114 |
+
+ # soccer
|
115 |
+
+ # stick-pull
|
116 |
+
+ # stick-push
|
117 |
+
+ # sweep-into
|
118 |
+
+ # sweep
|
119 |
+
+ # window-close
|
120 |
+
+ # window-open
|
121 |
+
)
|
122 |
+
|
123 |
+
for ENV in "${ENVS[@]}"; do
|
124 |
+
- python -m sample_factory.huggingface.load_from_hub -r qgallouedec/sample-factory-$ENV-v2
|
125 |
+
- python generate_dataset.py --env $ENV-v2 --experiment sample-factory-$ENV-v2 --train_dir=./train_dir
|
126 |
+
+ python -m sample_factory.huggingface.load_from_hub -r qgallouedec/$ENV-v2
|
127 |
+
+ python generate_dataset.py --env $ENV-v2 --experiment $ENV-v2 --train_dir=./train_dir
|
128 |
+
done
|
129 |
+
diff --git a/data/envs/metaworld/push_all.sh b/data/envs/metaworld/push_all.sh
|
130 |
+
index 9d71467..5b05c6d 100755
|
131 |
+
--- a/data/envs/metaworld/push_all.sh
|
132 |
+
+++ b/data/envs/metaworld/push_all.sh
|
133 |
+
@@ -2,57 +2,57 @@
|
134 |
+
|
135 |
+
ENVS=(
|
136 |
+
assembly
|
137 |
+
- basketball
|
138 |
+
- bin-picking
|
139 |
+
- box-close
|
140 |
+
- button-press-topdown
|
141 |
+
- button-press-topdown-wall
|
142 |
+
- button-press
|
143 |
+
- button-press-wall
|
144 |
+
- coffee-button
|
145 |
+
- coffee-pull
|
146 |
+
- coffee-push
|
147 |
+
- dial-turn
|
148 |
+
- disassemble
|
149 |
+
- door-close
|
150 |
+
- door-lock
|
151 |
+
- door-open
|
152 |
+
- door-unlock
|
153 |
+
- drawer-close
|
154 |
+
- drawer-open
|
155 |
+
- faucet-close
|
156 |
+
- faucet-open
|
157 |
+
- hammer
|
158 |
+
- hand-insert
|
159 |
+
- handle-press-side
|
160 |
+
- handle-press
|
161 |
+
- handle-pull-side
|
162 |
+
- handle-pull
|
163 |
+
- lever-pull
|
164 |
+
- peg-insert-side
|
165 |
+
- peg-unplug-side
|
166 |
+
- pick-out-of-hole
|
167 |
+
- pick-place
|
168 |
+
- pick-place-wall
|
169 |
+
- plate-slide-back-side
|
170 |
+
- plate-slide-back
|
171 |
+
- plate-slide-side
|
172 |
+
- plate-slide
|
173 |
+
- push-back
|
174 |
+
- push
|
175 |
+
- push-wall
|
176 |
+
- reach
|
177 |
+
- reach-wall
|
178 |
+
- shelf-place
|
179 |
+
- soccer
|
180 |
+
- stick-pull
|
181 |
+
- stick-push
|
182 |
+
- sweep-into
|
183 |
+
- sweep
|
184 |
+
- window-close
|
185 |
+
- window-open
|
186 |
+
+ # basketball
|
187 |
+
+ # bin-picking
|
188 |
+
+ # box-close
|
189 |
+
+ # button-press-topdown
|
190 |
+
+ # button-press-topdown-wall
|
191 |
+
+ # button-press
|
192 |
+
+ # button-press-wall
|
193 |
+
+ # coffee-button
|
194 |
+
+ # coffee-pull
|
195 |
+
+ # coffee-push
|
196 |
+
+ # dial-turn
|
197 |
+
+ # disassemble
|
198 |
+
+ # door-close
|
199 |
+
+ # door-lock
|
200 |
+
+ # door-open
|
201 |
+
+ # door-unlock
|
202 |
+
+ # drawer-close
|
203 |
+
+ # drawer-open
|
204 |
+
+ # faucet-close
|
205 |
+
+ # faucet-open
|
206 |
+
+ # hammer
|
207 |
+
+ # hand-insert
|
208 |
+
+ # handle-press-side
|
209 |
+
+ # handle-press
|
210 |
+
+ # handle-pull-side
|
211 |
+
+ # handle-pull
|
212 |
+
+ # lever-pull
|
213 |
+
+ # peg-insert-side
|
214 |
+
+ # peg-unplug-side
|
215 |
+
+ # pick-out-of-hole
|
216 |
+
+ # pick-place
|
217 |
+
+ # pick-place-wall
|
218 |
+
+ # plate-slide-back-side
|
219 |
+
+ # plate-slide-back
|
220 |
+
+ # plate-slide-side
|
221 |
+
+ # plate-slide
|
222 |
+
+ # push-back
|
223 |
+
+ # push
|
224 |
+
+ # push-wall
|
225 |
+
+ # reach
|
226 |
+
+ # reach-wall
|
227 |
+
+ # shelf-place
|
228 |
+
+ # soccer
|
229 |
+
+ # stick-pull
|
230 |
+
+ # stick-push
|
231 |
+
+ # sweep-into
|
232 |
+
+ # sweep
|
233 |
+
+ # window-close
|
234 |
+
+ # window-open
|
235 |
+
)
|
236 |
+
|
237 |
+
for ENV in "${ENVS[@]}"; do
|
238 |
+
- python enjoy.py --algo=APPO --env $ENV-v2 --experiment $ENV-v2 --train_dir=./train_dir --max_num_episodes=10 --push_to_hub --hf_repository=qgallouedec/sample-factory-$ENV-v2 --save_video --no_render --enjoy_script=enjoy --train_script=train --load_checkpoint_kind best
|
239 |
+
+ python enjoy.py --algo=APPO --env $ENV-v2 --experiment $ENV-v2 --train_dir=./train_dir --max_num_episodes=10 --push_to_hub --hf_repository=qgallouedec/$ENV-v2 --save_video --no_render --enjoy_script=enjoy --train_script=train --load_checkpoint_kind best
|
240 |
+
done
|
241 |
+
diff --git a/data/envs/metaworld/train_all.sh b/data/envs/metaworld/train_all.sh
|
242 |
+
index dbf328a..1b3c4c8 100755
|
243 |
+
--- a/data/envs/metaworld/train_all.sh
|
244 |
+
+++ b/data/envs/metaworld/train_all.sh
|
245 |
+
@@ -1,7 +1,7 @@
|
246 |
+
#!/bin/bash
|
247 |
+
|
248 |
+
ENVS=(
|
249 |
+
- assembly
|
250 |
+
+ # assembly
|
251 |
+
basketball
|
252 |
+
bin-picking
|
253 |
+
box-close
|
254 |
+
diff --git a/gia/eval/evaluator.py b/gia/eval/evaluator.py
|
255 |
+
index 91b645c..196a601 100644
|
256 |
+
--- a/gia/eval/evaluator.py
|
257 |
+
+++ b/gia/eval/evaluator.py
|
258 |
+
@@ -2,14 +2,16 @@ import torch
|
259 |
+
|
260 |
+
from gia.config.arguments import Arguments
|
261 |
+
from gia.model import GiaModel
|
262 |
+
+from typing import Optional
|
263 |
+
|
264 |
+
|
265 |
+
class Evaluator:
|
266 |
+
- def __init__(self, args: Arguments, task: str) -> None:
|
267 |
+
+ def __init__(self, args: Arguments, task: str, mean_random: Optional[float] = None) -> None:
|
268 |
+
self.args = args
|
269 |
+
self.task = task
|
270 |
+
+ self.mean_random = mean_random
|
271 |
+
|
272 |
+
- @torch.no_grad()
|
273 |
+
+ @torch.inference_mode()
|
274 |
+
def evaluate(self, model: GiaModel) -> float:
|
275 |
+
return self._evaluate(model)
|
276 |
+
|
277 |
+
diff --git a/gia/eval/mappings.py b/gia/eval/mappings.py
|
278 |
+
deleted file mode 100644
|
279 |
+
index e7ba9d3..0000000
|
280 |
+
--- a/gia/eval/mappings.py
|
281 |
+
+++ /dev/null
|
282 |
+
@@ -1,11 +0,0 @@
|
283 |
+
-TASK_TO_ENV_MAPPING = {
|
284 |
+
- "mujoco-ant": "Ant-v4",
|
285 |
+
- "mujoco-halfcheetah": "HalfCheetah-v4",
|
286 |
+
- "mujoco-hopper": "Hopper-v4",
|
287 |
+
- "mujoco-doublependulum": "InvertedDoublePendulum-v4",
|
288 |
+
- "mujoco-pendulum": "InvertedPendulum-v4",
|
289 |
+
- "mujoco-reacher": "Reacher-v4",
|
290 |
+
- "mujoco-swimmer": "Swimmer-v4",
|
291 |
+
- "mujoco-walker": "Walker2d-v4",
|
292 |
+
- # Atari etc...
|
293 |
+
-}
|
294 |
+
diff --git a/gia/eval/rl/__init__.py b/gia/eval/rl/__init__.py
|
295 |
+
index 36d890b..85a788d 100644
|
296 |
+
--- a/gia/eval/rl/__init__.py
|
297 |
+
+++ b/gia/eval/rl/__init__.py
|
298 |
+
@@ -1,4 +1,4 @@
|
299 |
+
from .gym_evaluator import GymEvaluator
|
300 |
+
+from .envs.core import make
|
301 |
+
|
302 |
+
-
|
303 |
+
-__all__ = ["GymEvaluator"]
|
304 |
+
+__all__ = ["GymEvaluator", "make"]
|
305 |
+
diff --git a/gia/eval/rl/gia_agent.py b/gia/eval/rl/gia_agent.py
|
306 |
+
index f0d0b9b..04b9637 100644
|
307 |
+
--- a/gia/eval/rl/gia_agent.py
|
308 |
+
+++ b/gia/eval/rl/gia_agent.py
|
309 |
+
@@ -75,6 +75,11 @@ class GiaAgent:
|
310 |
+
) -> Tuple[Tuple[Tensor, Tensor], ...]:
|
311 |
+
return tuple((k[:, :, -self._max_length :], v[:, :, -self._max_length :]) for (k, v) in past_key_values)
|
312 |
+
|
313 |
+
+ def set_model(self, model: GiaModel) -> None:
|
314 |
+
+ self.model = model
|
315 |
+
+ self.device = next(model.parameters()).device
|
316 |
+
+ self._max_length = self.model.config.max_position_embeddings
|
317 |
+
+
|
318 |
+
def reset(self, num_envs: int = 1) -> None:
|
319 |
+
if self.prompter is not None:
|
320 |
+
prompts = self.prompter.generate_prompts(num_envs)
|
321 |
+
diff --git a/gia/eval/rl/gym_evaluator.py b/gia/eval/rl/gym_evaluator.py
|
322 |
+
index f8531ee..754c05d 100644
|
323 |
+
--- a/gia/eval/rl/gym_evaluator.py
|
324 |
+
+++ b/gia/eval/rl/gym_evaluator.py
|
325 |
+
@@ -1,7 +1,7 @@
|
326 |
+
import gym
|
327 |
+
from gym.vector.vector_env import VectorEnv
|
328 |
+
|
329 |
+
-from gia.eval.mappings import TASK_TO_ENV_MAPPING
|
330 |
+
+# from gia.eval.rl.envs.mappings import TASK_TO_ENV_MAPPING
|
331 |
+
from gia.eval.rl.rl_evaluator import RLEvaluator
|
332 |
+
|
333 |
+
|
334 |
+
diff --git a/gia/eval/rl/rl_evaluator.py b/gia/eval/rl/rl_evaluator.py
|
335 |
+
index c5cc423..ca0c7da 100644
|
336 |
+
--- a/gia/eval/rl/rl_evaluator.py
|
337 |
+
+++ b/gia/eval/rl/rl_evaluator.py
|
338 |
+
@@ -8,6 +8,9 @@ from gia.eval.rl.gia_agent import GiaAgent
|
339 |
+
|
340 |
+
|
341 |
+
class RLEvaluator(Evaluator):
|
342 |
+
+ def __init__(self, args, task):
|
343 |
+
+ super().__init__(args, task)
|
344 |
+
+ self.agent = GiaAgent()
|
345 |
+
def _build_env(self) -> VectorEnv: # TODO: maybe just a gym.Env ?
|
346 |
+
raise NotImplementedError
|
347 |
+
|
replay.mp4
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:23c9f230036c64e975bc021b96a313ba7f4bc9ad230969145be81a3b4a7e2471
|
3 |
+
size 2553079
|
sf_log.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|