Setting up anaconda for keras-rl



Original Source Here

Setting up anaconda for keras-rl

Got stuck while trying to work with keras-rl github repository?
then this article is for you.

Context

After reading the README.md and exploring the repo, you wanted to try some examples as provided in the readme file but, unexpectedly you ran into multiple errors due to the environment I had running?
Well, I personally spent a lot of time installing and deleting packages to get the right versions to work with that package.

Therefore, I am here today to show you how to set up your environment (and save some time πŸ˜‰ ) using anaconda (you can do it on virtualenv, figure it out yourself πŸ˜‰ ) to avoid any conflicts and to save your energy for learning and not fixing some versioning errors.

Anaconda Download/install

First of all, Download and Install Anaconda on your machine.

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

(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

ubuntu:

pip install atari-py==0.2.6

AI/ML

Trending AI/ML Article Identified & Digested via Granola by Ramsey Elbasheer; a Machine-Driven RSS Bot

%d bloggers like this: