To run this project, ensure Python 3.8 or later is installed. Follow the steps below to set up the environment:
pip install -r requirements.txt
For NVIDIA GPUs (CUDA versions):
CUDA 11.8
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
CUDA 12.1
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
CUDA 12.4
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
using Mac or Window cpu environment
pip install torch torchvision torchaudio
Run the playable snake game:
python snake_playable.py
Use genetic algorithms to evolve the snake:
python genetic/main_genetic.py
Run the DQN-based snake AI:
python dqn/main_dqn.py
Snake game code by HonzaKral: https://gist.github.com/HonzaKral/833ee2b30231c53ec78e