[PYTORCH] Reinforcement Learning-Super Mario Bros Using CNNPolicy
Packages Used:
- gym-super-mario-Bros == 7.3.2
- gym == 0.21.0
- ipykernal
- Stable-Baselines3
- Pytorch 1.13
Setting Up Pytorch
I would recoomend you to check official Pytorch website to install it
The Pytorch need the exact version of Cuda and CUDnn to work normally
Pytorch website: pytorch
Creating Virtual Environment:
setting up a virtual environment will really help in Creating a seperatiion wwithin your workspace and PC
Run following to create a virtual environment
- launch cmd
- move to your desired directory
- Run the following:
python -m venv mario
activate your virtual env using following:
.\mario\Scripts\activate
to deactivte just type deactivate in cmd
Creating a New kernel in Jupyter Notebook
After installing Ipykernal run the following:
python -m ipykernel install --user --name=mario
note: the name of kernel should be same as venv name
Training the Agent
Either clone my repo or download the zip or copy paste the code and run them
Github clone Link: https://github.com/harikris001/Super-Mario-Reinforcement_Learning.git
Run the cells and wait for it to complete.
After Training:
I have attached the Pre trained models u can resume training using these model and save the result
The best model during my training was 4M model so i have attached that