Skip to content

Commit dccef7c

Browse files
Release 0.7.0
1 parent f10832c commit dccef7c

20 files changed

+35
-49
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ __pycache__/
1919
*$py.class
2020

2121
# C extensions
22-
*.so
22+
# *.so
2323

2424
# Distribution / packaging
2525
.Python

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ This works on any track, using any (sensible) camera configuration.
242242
}
243243
```
244244
Note that human players can see or hear the features provided by this environment: we provide no "cheat" that would render the approach non-transferable to the real world.
245-
In case you do wish to cheat, though, you can easily take inspiration from our [rtgym interfaces](https://github.com/trackmania-rl/tmrl/blob/master/tmrl/custom/custom_gym_interfaces.py) to build your own custom environment for TrackMania.
245+
In case you do wish to cheat, though, you can easily take inspiration from our [rtgym interfaces](https://github.com/trackmania-rl/tmrl/blob/master/tmrl/custom/tm/tm_gym_interfaces.py) to build your own custom environment for TrackMania.
246246

247247
The `Full` environment is used in the official [TMRL competition](https://github.com/trackmania-rl/tmrl/blob/master/readme/competition.md), and custom environments are featured in the "off" competition :wink:
248248

@@ -471,7 +471,7 @@ This project uses [Real-Time Gym](https://github.com/yannbouteiller/rtgym) (```r
471471

472472
Time-steps are being elastically constrained to their nominal duration. When this elastic constraint cannot be satisfied, the previous time-step times out and the new time-step starts from the current timestamp.
473473

474-
Custom `rtgym` interfaces for Trackmania used by `tmrl` are implemented in [custom_gym_interfaces.py](https://github.com/yannbouteiller/tmrl/blob/master/tmrl/custom/custom_gym_interfaces.py).
474+
Custom `rtgym` interfaces for Trackmania used by `tmrl` are implemented in [tm_gym_interfaces.py](https://github.com/yannbouteiller/tmrl/blob/master/tmrl/custom/tm/tm_gym_interfaces.py).
475475

476476
## Remote training architecture:
477477

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[build-system]
2+
requires = [
3+
"setuptools",
4+
]
5+
build-backend = "setuptools.build_meta"

readme/tuto_library.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ We use [Real-Time Gym](https://github.com/yannbouteiller/rtgym) (`rtgym`) to wra
169169
But you can use an environment of your choice, as long as it is registered as a Gymnasium environment.
170170

171171
To build your own real-time environment (e.g., an environment for your own robot or video game), you can follow the [rtgym tutorial](https://github.com/yannbouteiller/rtgym#tutorial).
172-
If you need inspiration, you can find our `rtgym` interfaces for TrackMania in [custom_gym_interfaces.py](https://github.com/trackmania-rl/tmrl/blob/master/tmrl/custom/custom_gym_interfaces.py).
172+
If you need inspiration, you can find our `rtgym` interfaces for TrackMania in [tm_gym_interfaces.py](https://github.com/trackmania-rl/tmrl/blob/master/tmrl/custom/tm/tm_gym_interfaces.py).
173173

174174
For the sake of the `tmrl` tutorial, we will be using the dummy RC drone environment from the `rtgym` tutorial:
175175

@@ -558,7 +558,7 @@ A few more parameters are configurable, although they will not be useful in this
558558
In particular:
559559

560560
`obs_preprocessor` can be used to modify observations returned by the environment (this enables, e.g., converting RGB images into grayscale without modifying the environment).
561-
Some examples of such preprocessors are available [here](https://github.com/trackmania-rl/tmrl/blob/master/tmrl/custom/custom_preprocessors.py).
561+
Some examples of such preprocessors are available [here](https://github.com/trackmania-rl/tmrl/blob/master/tmrl/custom/tm/tm_preprocessors.py).
562562

563563
`standalone` can be set to `True` for deployment, in which case the `RolloutWorker` will not attempt to connect to the `Server`.
564564

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
import urllib.error
1010
import socket
1111

12+
13+
TMRL_VERSION = '0.7.0'
14+
15+
1216
if sys.version_info < (3, 7):
1317
sys.exit('Sorry, Python < 3.7 is not supported.')
1418

@@ -137,13 +141,13 @@ def url_retrieve(url: str, outfile: Path, overwrite: bool = False):
137141

138142
setup(
139143
name='tmrl',
140-
version='0.6.6',
144+
version=TMRL_VERSION,
141145
description='Network-based framework for real-time robot learning',
142146
long_description=README,
143147
long_description_content_type='text/markdown',
144148
keywords='reinforcement learning, robot learning, trackmania, self driving, roborace',
145149
url='https://github.com/trackmania-rl/tmrl',
146-
download_url='https://github.com/trackmania-rl/tmrl/archive/refs/tags/v0.6.6.tar.gz',
150+
download_url=f'https://github.com/trackmania-rl/tmrl/archive/refs/tags/v{TMRL_VERSION}.tar.gz',
147151
author='Yann Bouteiller, Edouard Geze',
148152
149153
license='MIT',

tmrl/actor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def save(self, path):
134134

135135
def load(self, path, device):
136136
self.device = device
137-
self.load_state_dict(torch.load(path, map_location=self.device))
137+
self.load_state_dict(torch.load(path, map_location=self.device, weights_only=True))
138138
return self
139139

140140
def act_(self, obs, test=False):

tmrl/config/config_objects.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
# from tmrl.custom.custom_checkpoints import load_run_instance_images_dataset, dump_run_instance_images_dataset
33
# third-party imports
44

5-
import numpy as np
65
import rtgym
76

87
# local imports
98
import tmrl.config.config_constants as cfg
109
from tmrl.training_offline import TorchTrainingOffline
11-
from tmrl.custom.custom_gym_interfaces import TM2020Interface, TM2020InterfaceLidar, TM2020InterfaceLidarProgress
10+
from tmrl.custom.tm.tm_gym_interfaces import TM2020Interface, TM2020InterfaceLidar, TM2020InterfaceLidarProgress
1211
from tmrl.custom.custom_memories import MemoryTMFull, MemoryTMLidar, MemoryTMLidarProgress, get_local_buffer_sample_lidar, get_local_buffer_sample_lidar_progress, get_local_buffer_sample_tm20_imgs
13-
from tmrl.custom.custom_preprocessors import obs_preprocessor_tm_act_in_obs, obs_preprocessor_tm_lidar_act_in_obs,obs_preprocessor_tm_lidar_progress_act_in_obs
12+
from tmrl.custom.tm.tm_preprocessors import obs_preprocessor_tm_act_in_obs, obs_preprocessor_tm_lidar_act_in_obs, obs_preprocessor_tm_lidar_progress_act_in_obs
1413
from tmrl.envs import GenericGymEnv
1514
from tmrl.custom.custom_models import SquashedGaussianMLPActor, MLPActorCritic, REDQMLPActorCritic, RNNActorCritic, SquashedGaussianRNNActor, SquashedGaussianVanillaCNNActor, VanillaCNNActorCritic, SquashedGaussianVanillaColorCNNActor, VanillaColorCNNActorCritic
1615
from tmrl.custom.custom_algorithms import SpinupSacAgent as SAC_Agent

tmrl/custom/custom_algorithms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# local imports
1212
import tmrl.custom.custom_models as core
1313
from tmrl.custom.utils.nn import copy_shared, no_grad
14-
from tmrl.util import cached_property, partial
14+
from tmrl.util import cached_property
1515
from tmrl.training import TrainingAgent
1616
import tmrl.config.config_constants as cfg
1717

tmrl/custom/tm/__init__.py

Whitespace-only changes.

tmrl/custom/custom_gym_interfaces.py renamed to tmrl/custom/tm/tm_gym_interfaces.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515

1616
# local imports
1717
import tmrl.config.config_constants as cfg
18-
from tmrl.custom.utils.compute_reward import RewardFunction
19-
from tmrl.custom.utils.control_gamepad import control_gamepad, gamepad_reset, gamepad_close_finish_pop_up_tm20
20-
from tmrl.custom.utils.control_mouse import mouse_close_finish_pop_up_tm20
21-
from tmrl.custom.utils.control_keyboard import apply_control, keyres
22-
from tmrl.custom.utils.window import WindowInterface
23-
from tmrl.custom.utils.tools import Lidar, TM2020OpenPlanetClient, save_ghost
18+
from tmrl.custom.tm.utils.compute_reward import RewardFunction
19+
from tmrl.custom.tm.utils.control_gamepad import control_gamepad, gamepad_reset, gamepad_close_finish_pop_up_tm20
20+
from tmrl.custom.tm.utils.control_mouse import mouse_close_finish_pop_up_tm20
21+
from tmrl.custom.tm.utils.control_keyboard import apply_control, keyres
22+
from tmrl.custom.tm.utils.window import WindowInterface
23+
from tmrl.custom.tm.utils.tools import Lidar, TM2020OpenPlanetClient, save_ghost
2424

2525
# Globals ==============================================================================================================
2626

0 commit comments

Comments
 (0)