meraccos / f1tenth_reinforcement_learning

PPO RL agent for F1TENTH racing, simulation and experiment
MIT License
5 stars 1 forks source link

Unable to run train.py, 'F110Env' object has no attribute 'map_data' #1

Open wongm3079 opened 9 months ago

wongm3079 commented 9 months ago

Unable to run train.py After cloning the repository. and running python3 train.py. An error shows when creating an environment. The F110Env object does not show to have a map_data attribute.

To Reproduce Steps to reproduce the behavior:

  1. Clone the Github repository
  2. navigate to the work directory
  3. run the command python3 train.py
  4. Observe Issue

Expected Behavior Successfully create the environment, train the model, and save the model

Actual Behavior Screenshot from 2024-01-02 17-04-29

Desktop:

Additional context

  1. Changing the device from cuda to cpu in train.py has no effect in changing the result
  2. Added a line on Line 64 that saves the model: model.save("save path")
wongm3079 commented 9 months ago

Closing issue as is related to virtual environment setup. Issue is not reproduced when running outside a virtual environment.

wongm3079 commented 9 months ago

Re-opening Issue due to PPO class not recognizing the action space. Attached screenshot for more information image

meraccos commented 9 months ago

I believe this issue is related to the newer versions of stable baselines3, which uses gymnasium instead of gym. Try installing stablebaselines3 < v2.0 and run again.