AndrejGobeX / TrackMania_AI

Racing game AI
GNU General Public License v3.0
102 stars 11 forks source link

Error occurred on line 58 while running RL-Trainer.py #21

Open cdgg1234 opened 6 months ago

cdgg1234 commented 6 months ago

Why can't I find Sunset.Map.txt in the Maps folder?

cdgg1234 commented 6 months ago

Wrapping the env in a DummyVecEnv. Traceback (most recent call last): File "C:\Users\dianchen\Desktop\TrackMania_AI-main_new\RL_Trainer.py", line 81, in model.learn(total_timesteps=100_000, tb_log_name=run_name, reset_num_timesteps=reset_timesteps, callback=callbacks) File "F:\anaconda3\envs\nanogpt\lib\site-packages\stable_baselines3\td3\td3.py", line 222, in learn return super().learn( File "F:\anaconda3\envs\nanogpt\lib\site-packages\stable_baselines3\common\off_policy_algorithm.py", line 314, in learn total_timesteps, callback = self._setup_learn( File "F:\anaconda3\envs\nanogpt\lib\site-packages\stable_baselines3\common\off_policy_algorithm.py", line 297, in _setup_learn return super()._setup_learn( File "F:\anaconda3\envs\nanogpt\lib\site-packages\stable_baselines3\common\base_class.py", line 423, in _setup_learn self._last_obs = self.env.reset() # type: ignore[assignment] File "F:\anaconda3\envs\nanogpt\lib\site-packages\stable_baselines3\common\vec_env\dummy_vec_env.py", line 77, in reset obs, self.reset_infos[env_idx] = self.envs[env_idx].reset(seed=self._seeds[env_idx], maybe_options) File "F:\anaconda3\envs\nanogpt\lib\site-packages\stable_baselines3\common\monitor.py", line 83, in reset return self.env.reset(kwargs) File "C:\Users\dianchen\Desktop\TrackMania_AI-main_new\TrackmaniaEnv.py", line 325, in reset self.respawn() File "C:\Users\dianchen\Desktop\TrackMania_AI-main_new\TrackmaniaEnv.py", line 154, in respawn self.refresh_observation() File "C:\Users\dianchen\Desktop\TrackMania_AI-main_new\TrackmaniaEnv.py", line 172, in refresh_observation view = self.visualizer.lidar(self.location, TrackmaniaEnv.vector_angle(self.direction), show=False) File "C:\Users\dianchen\Desktop\TrackMania_AI-main_new\TrackVisualizer.py", line 113, in lidar return self.lidar_13(img, show=show) / TrackVisualizer.MAX_DISTANCE File "C:\Users\dianchen\Desktop\TrackMania_AI-main_new\TrackVisualizer.py", line 89, in lidar_13 index = armin(np.all(img[axis_x, axis_y] < self.black_threshold, axis=1)) IndexError: index 100 is out of bounds for axis 0 with size 26

AndrejGobeX commented 6 months ago

Hmmmm, I have no idea... I am offline these days, so I won't have time to check this... I had this same thing, bit I thought I've fixed this...