Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No train.py? #7

Open
mgagvani opened this issue Oct 18, 2023 · 3 comments
Open

No train.py? #7

mgagvani opened this issue Oct 18, 2023 · 3 comments

Comments

@mgagvani
Copy link

I was trying to run Learning to Drive in 5 minutes but the Stable Baselines version is dependent on TensorFlow 1 which can't be installed on later Python versions. Thus, I went back to this repo however I don't see a script to run the reinforcement learning. Where can I find the script used in this video: https://www.youtube.com/watch?v=iiuKh0yDyKE?

Thank you in advance.

@araffin
Copy link
Owner

araffin commented Oct 19, 2023

For an (almost) up to date tutorial, please take a look at https://m.youtube.com/playlist?list=PL42jkf1t1F7dFXE7f0VTeFLhW0ZEQ4XJV

@mgagvani
Copy link
Author

mgagvani commented Nov 4, 2023

I appreciate it. I've been following the tutorial but I'm stuck at the part where you use the RL Baselines Zoo for training:
(donkeysim) PS F:\Projects\donkey\rl-baselines3-zoo> python train.py --algo tqc --env donkey-mountain-track-v0 --eval-freq -1 --save-freq 20000 ========== donkey-mountain-track-v0 ========== Seed: 3690327169 Default hyperparameters for environment (ones being tuned will be overridden): OrderedDict([('batch_size', 256), ('buffer_size', 10000), ('callback', [{'utils.callbacks.ParallelTrainCallback': {'gradient_steps': 200}}]), ('ent_coef', 'auto'), ('gamma', 0.99), ('gradient_steps', 256), ('learning_rate', 0.00073), ('n_timesteps', 2000000.0), ('policy', 'CnnPolicy'), ('tau', 0.02), ('train_freq', 200)]) Using 1 environments Traceback (most recent call last): File "F:\Projects\donkey\rl-baselines3-zoo\train.py", line 220, in <module> model = exp_manager.setup_experiment() File "F:\Projects\donkey\rl-baselines3-zoo\utils\exp_manager.py", line 173, in setup_experiment env = self.create_envs(n_envs, no_log=False) File "F:\Projects\donkey\rl-baselines3-zoo\utils\exp_manager.py", line 522, in create_envs env = make_vec_env( File "C:\Users\mgagv\anaconda3\envs\donkeysim\lib\site-packages\stable_baselines3\common\env_util.py", line 125, in make_vec_env vec_env = vec_env_cls([make_env(i + start_index) for i in range(n_envs)], **vec_env_kwargs) File "C:\Users\mgagv\anaconda3\envs\donkeysim\lib\site-packages\stable_baselines3\common\vec_env\dummy_vec_env.py", line 30, in __init__ self.envs = [_patch_env(fn()) for fn in env_fns] File "C:\Users\mgagv\anaconda3\envs\donkeysim\lib\site-packages\stable_baselines3\common\vec_env\dummy_vec_env.py", line 30, in <listcomp> self.envs = [_patch_env(fn()) for fn in env_fns] File "C:\Users\mgagv\anaconda3\envs\donkeysim\lib\site-packages\stable_baselines3\common\env_util.py", line 94, in _init env = gym.make(env_id, **kwargs) # type: ignore[arg-type] File "C:\Users\mgagv\anaconda3\envs\donkeysim\lib\site-packages\gymnasium\envs\registration.py", line 741, in make env_spec = _find_spec(id) File "C:\Users\mgagv\anaconda3\envs\donkeysim\lib\site-packages\gymnasium\envs\registration.py", line 527, in _find_spec _check_version_exists(ns, name, version) File "C:\Users\mgagv\anaconda3\envs\donkeysim\lib\site-packages\gymnasium\envs\registration.py", line 393, in _check_version_exists _check_name_exists(ns, name) File "C:\Users\mgagv\anaconda3\envs\donkeysim\lib\site-packages\gymnasium\envs\registration.py", line 370, in _check_name_exists raise error.NameNotFound( gymnasium.error.NameNotFound: Environment donkey-mountain-track doesn't exist.

I'm not sure what I need to do to register the env with Gymnasium. Also, it says "donkey-mountain-track", omitting the v0, this might be the problem.

@mgagvani mgagvani reopened this Nov 4, 2023
@araffin
Copy link
Owner

araffin commented Nov 6, 2023

Hello,
gym donkey car doesn't support gymnasium yet (but a PR is welcome).
In the meantime, you can downgrade to gym 0.21 and SB3 1.x (with the corresponding rl zoo version).

See openai/gym#3176 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants