becktepe commited on
Commit
dcf867c
·
verified ·
1 Parent(s): ca1f730

Add files using upload-large-folder tool

Browse files
Files changed (1) hide show
  1. README.md +19 -2
README.md CHANGED
@@ -22,8 +22,8 @@ model-index:
22
  - type: mean_reward
23
  value: -0.31
24
  name: mean_reward
25
- predict_config:
26
- preview_file: replay.mp4
27
  ---
28
 
29
  # PPO on RBC2D-hard-v0 (FluidGym)
@@ -52,6 +52,23 @@ Each seed is contained in its own subdirectory. You can load a model using:
52
  ```python
53
  from stable_baselines3 import PPO
54
  model = PPO.load("0/ckpt_latest.zip")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  ```
56
 
57
  ## References
 
22
  - type: mean_reward
23
  value: -0.31
24
  name: mean_reward
25
+
26
+
27
  ---
28
 
29
  # PPO on RBC2D-hard-v0 (FluidGym)
 
52
  ```python
53
  from stable_baselines3 import PPO
54
  model = PPO.load("0/ckpt_latest.zip")
55
+
56
+ **Important:** The models were trained using ```fluidgym==0.0.2```. In order to use
57
+ them with newer versions of FluidGym, you need to wrap the environment with a
58
+ `FlattenObservation` wrapper as shown below:
59
+ ```python
60
+ import fluidgym
61
+ from fluidgym.wrappers import FlattenObservation
62
+ from stable_baselines3 import PPO
63
+
64
+ env = fluidgym.make("RBC2D-hard-v0")
65
+ env = FlattenObservation(env)
66
+ model = PPO.load("path_to_model/ckpt_latest.zip")
67
+
68
+ obs, info = env.reset(seed=42)
69
+
70
+ action, _ = model.predict(obs, deterministic=True)
71
+ obs, reward, terminated, truncated, info = env.step(action)
72
  ```
73
 
74
  ## References