Usage Video#
Quick Facts#
Here we provide Examples of how to use OmniSafe.
You can train policy by running omnisafe train .
You can customize the configuration of the algorithm by running omnisafe train-config .
You can run a benchmark by running omnisafe benchmark .
You can run an evaluation by running omnisafe evaluate .
Train policy#
Example
You can train a policy by running:
omnisafe train
--algo PPO --total-steps 1024
--vector-env-nums 1
--custom-cfgs algo_cfgs:update_cycle 512
Here we provide a video example:
Hint
The above command will train a policy with PPO algorithm, and the total training steps is 1024. The vector environment number is 1, which means that the training process will use 1 CPU core. The algo_cfgs:update_cycle
is the update cycle of the PPO algorithm, which means that the policy will be updated every 512 steps.
Customize Configuration#
Example
You can also customize the configuration of the algorithm by running:
omnisafe train-config ./saved_source/train_config.yaml
Here we provide a video example:
Hint
The above command will generate a configuration file train_config.yaml
in the saved_source
directory. We have provided an example showing the file layer of the configuration file. You can customize the configuration of the algorithm in this file.
Run Benchmark#
Example
You can run a benchmark by running:
omnisafe benchmark benchmark 2 ./saved_source/benchmark_config.yaml
Here we provide a video example:
Hint
The above command will run a benchmark with 2 CPU cores. The configuration file benchmark_config.yaml
is in the saved_source
directory. We have provided an example showing the file layer of the configuration file. You can customize the configuration of the benchmark in this file.
Run Evaluation#
Example
You can run an evaluation by running:
omnisafe evaluate evaluate 2 ./saved_source/evaluate_config.yaml
Here we provide a video example:
Hint
The above command will run an evaluation with 2 CPU cores. The configuration file evaluate_config.yaml
is in the saved_source
directory. We have provided an example showing the file layer of the configuration file. You can customize the configuration of the evaluation in this file.
Get Help#
Example
If you have any questions, you can get help by running:
omnisafe --help
Then you will see:
Hint
The above command will show the help information of OmniSafe, which may help you to some degree. If you still have any questions, just feel free to open an issue.