Skip to content

Commit

Permalink
Release 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbouteiller committed Mar 19, 2022
1 parent 0e72b80 commit 317d8b9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
2 changes: 1 addition & 1 deletion readme/Install.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#### If using Anaconda on Windows:

We recommend you install the conda version of `pywin32`:
We recommend installing the conda version of `pywin32`:

```terminal
conda install pywin32
Expand Down
28 changes: 27 additions & 1 deletion readme/get_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,42 @@ python -m tmrl --test
You should now see the car drive autonomously.

### Troubleshooting:
#### Errors:
If you get an error saying that communication was refused, try reloading the `TMRL grab data` script in the OpenPlanet menu.

If you see many warnings saying that time-steps time out, this means that your computer struggles at running the AI and trackmania in parallel.
In case you get a DLL error from the `win32gui/win32ui/win32con` library, install `pywin32` without using `pip` (e.g., use `conda install pywin32`).

#### Profiling / optimization:
If you see many warnings complaining about time-steps timing out, this means that your computer struggles at running the AI and trackmania in parallel.
Try reducing the trackmania graphics to the minimum (in particular, try setting the maximum fps to 30, but not much less than this, because screenshots are captured at 20 fps)
_(NB: seeing these warnings once at each environment reset is normal, this is because we purposefully sleep when the car is waiting for green light)._

In the `Graphics` tab of the TM20 settings, ensure that the resolution is 958 (width) * 488 (height) pixels.

The `Input` setting for gamepads must be the default.

More insight regarding your bottlenecks can be gained using the `--benchmark` option.
This requires you to set the `"benchmark"` entry to `true` in `config.json`, and then run:
```bash
python -m tmrl --benchmark
```
This will run an episode and print results such as:
```terminal
Benchmark results:
{'time_step_duration': (0.04973503448440074, 0.0026528655942530876),
'step_duration': (0.04807219094465544, 0.002513953782792142),
'join_duration': (0.04780806270254146, 0.002499383592620444),
'inference_duration': (0.001633495957288204, 0.0004890919531246595),
'send_control_duration': (0.0006831559519106576, 0.0004686670785507652),
'retrieve_obs_duration': (0.024897294799567357, 0.0023167497316040745)}
```
where each tuple is a duration in seconds representing `(mean, mean deviation)`.

For instance, here, we can see that time-steps are of 0.05s (20 FPS), with a very fast inference (policy), and observation retrieval (screenshot + lidar computation) being a potential bottleneck with a non-negligible mean of 0.025s.
Note that inference and observation retrieval happen in parallel:
in the very worst case, both could be almost 0.05s.
Therefore, we have some margin here, in particular regarding the policy.

## Train your own self-driving AI

`tmrl` enables training your own policies, on your own tracks:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ def url_retrieve(url: str, outfile: Path, overwrite: bool = False):

setup(
name='tmrl',
version='0.1.1',
version='0.1.2',
description='Autonomous racing in Trackmania',
long_description=README,
long_description_content_type='text/markdown',
keywords='reinforcement learning, trackmania, self driving, roborace',
url='https://github.com/trackmania-rl/tmrl',
download_url='https://github.com/trackmania-rl/tmrl/archive/refs/tags/v0.1.1.tar.gz',
download_url='https://github.com/trackmania-rl/tmrl/archive/refs/tags/v0.1.2.tar.gz',
author='Yann Bouteiller, Edouard Geze',
author_email='[email protected], [email protected]',
license='MIT',
Expand Down

0 comments on commit 317d8b9

Please sign in to comment.