- python=3.8
- numpy==1.19.5
- gym==0.18.3
- keras==2.1.0
- keras-rl2 # Now installed via Conda
- h5py==2.10.0
- Pillow==7.1.2
- atari-py==0.2.6
- tensorflow==2.2
Training_DQN_Agent_Atari_Breakout.ipynb
Conda is a package and environment management system that allows you to install software packages and manage different environments for various projects. Follow these steps to set up a Conda environment:
conda create --name atari_breakout python=3.5
.conda activate atari_breakout
on Windows or source activate atari_breakout
on macOS and Linux.Environment Creation/Configuration
Create these files under a folder of your choice.
Environment.yml
name: deep
channels:
- anaconda
- defaults
dependencies:
- python=3.6
- pip
- pip:
- pip
(notice that I wrote pip three times; the first one is to install pip, but, that installs pip version 20.2.4
the two other lines are to upgrade pip to the latest version to avoid annoying errors/warnings later)
Requirements.txt
h5py==2.10.0
keras==2.2.4
keras-rl==0.4.2
numpy==1.18.5
opencv-python==4.4.0.42
pyyaml==5.3.1
six==1.15.0
gym
Pillow
tensorflow==1.14.0
Store both these files in a folder and open command prompt (powershell for windows and terminal in ubuntu :) ) and cd to the directory where you put those files.
You need to create the anaconda environment, so enter this command:
conda env create -f environment.yml
Second, you should activate the environment created
conda activate deep
Initialize Conda for Your Shell
Open Terminal: Open your terminal (Command Prompt on Windows, Terminal on macOS or Linux).
Run Conda Init: Run the conda init command for your specific shell. The shell name is usually the name of the terminal you are using. For example, if you are using bash, you would run:
bash
conda init bash
If you're using a different shell, replace bash with the name of your shell (e.g., zsh, fish, cmd.exe, etc.).
Restart Shell: Close and reopen your terminal window or start a new shell session to apply the changes.
Verify Configuration
After restarting your shell, try activating your environment again:
bash
conda activate deepQ
If everything is set up correctly, this should activate your deepQ environment without any issues.
(notice that the name of the environment deep is mentioned in the first line in the environment.yml file)
So now, that you are inside the anaconda environment. You need to complete the installation of the remaining requirements.
pip install -r requirements.txt # installs all packages in the file
Lastly, is to install atari_py
Windows:
pip install --no-index -f <https://github.com/Kojoley/atari-py/releases> atari_py
Using Jupyter Notebook:
Install ipykernel conda install -c anaconda ipykernel
Send this environment to ipykernel python -m ipykernel install --user --name=deepQ
When starting the notebook select the deepQ kernel.
For more details, check the Conda documentation.