feat: improve device handling and add stochastic option

This commit is contained in:
2026-02-12 19:13:12 +08:00
parent d23de69b9a
commit 71008dfb72
4 changed files with 52 additions and 18 deletions

View File

@@ -143,13 +143,13 @@ tensorboard --logdir artifacts/logs --port 6006
加载最新模型,跑 N 个 episode输出平均指标
```bash
python -m src.eval --episodes 5
python -m src.eval --episodes 5 --stochastic
```
可指定模型:
```bash
python -m src.eval --model-path artifacts/models/latest_model.zip --episodes 10
python -m src.eval --model-path artifacts/models/latest_model.zip --episodes 10 --stochastic
```
注意:`eval.py` 默认 `--movement auto`,会按模型动作维度自动匹配 `right_only/simple`,避免动作空间不一致导致 `KeyError`
@@ -174,13 +174,13 @@ _total_timesteps = 150000
默认录制约 10 秒 mp4 到 `artifacts/videos/`
```bash
python -m src.record_video --duration-sec 10 --fps 30
python -m src.record_video --duration-sec 10 --fps 30 --stochastic
```
可指定输出路径:
```bash
python -m src.record_video --output artifacts/videos/demo.mp4 --duration-sec 10
python -m src.record_video --output artifacts/videos/demo.mp4 --stochastic --duration-sec 10
```
注意:`record_video.py` 默认 `--movement auto`,会按模型自动匹配动作空间。