Skip to content

Commit

Permalink
Updating tutorial instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
ansantam committed Mar 4, 2024
1 parent fc8b75f commit 2e43ab6
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 32 deletions.
124 changes: 94 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,128 @@

You can view the tutorial notebook as [HTML slides here](https://RL4AA.github.io/rl-tutorial-ares-basic/slides.html#/).


## Download the repository

### Get the repository with Git

You will need to have Git previously installed in your computer.
To check if you have it installed, open your terminal and type:

``` bash
git --version
```

#### Git installation in MacOS

``` bash
brew update
brew install git
```

#### Git installation in Linux

In Ubuntu/Debian

``` bash
sudo apt install git
```

In CentOS

``` bash
sudo yum install git
```

Once you have Git installed open your terminal, go to your desired directory, and type:

``` bash
git clone https://github.com/RL4AA/rl-tutorial-ares-basic.git
```

Then enter the downloaded repository:
``` bash
cd rl-tutorial-ares-basic
```

### Get the repository with direct download

Open your terminal, go to your desired directory, and type:

``` bash
wget https://github.com/RL4AA/rl-tutorial-ares-basic/archive/refs/heads/main.zip
unzip main.zip
cd rl-tutorial-ares-basic
```

## Getting started

- First, download the material to your local disk by cloning the repository using
- HTTPS: `git clone https://github.com/RL4AA/rl-tutorial-ares-basic.git`
- ssh: `git clone [email protected]:RL4AA/rl-tutorial-ares-basic.git`
- If you don't have git installed, you can click on the green button that says `Code`, and choose to download it as a `.zip` file.
You need to install the dependencies before running the notebooks.

### Using conda

If you don't have conda installed already and want to use conda for environment management, you can install the miniconda as [described here](https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html).

### Install `ffmpeg`
- Create a conda env with `conda create -n rl-icfa python=3.10`
- Activate the environment with `conda activate rl-icfa`
- Install the required packages via `pip install -r requirements.txt`.
- Additional installation steps:

Please also run these commands to install `ffmpeg`:
- OS X: `brew install ffmpeg`
- Ubuntu: `sudo apt-get install ffmpeg`
- With pip: `pip install imageio-ffmpeg`

### Set up the environment locally
Finally, install the notebook extensions if you want to see them in slide mode:
```bash
python -m jupyter contrib nbextension install --user
python -m jupyter nbextension enable varInspector/main
```

- Open terminal app
- (Suggested) Create a virtual environment using `conda` or `venv`.
- **After the tutorial** you can remove your environment with `conda remove -n rl-icfa --all`

#### Using conda only
### Using venv only

Instructions to install miniconda [here](https://docs.anaconda.com/free/miniconda/miniconda-install/)
If you do not have conda installed:

Alternatively, you can create the virtual env with `venv` in the standard library

```bash
conda env create -f environment.yml
conda activate rl-tutorial
jupyter notebook
python -m venv rl-icfa
```

- Open the tutorial notebook `tutorial.ipynb` in the jupyter server in browser
- When you are done type `conda deactivate` to deactivate the virtual environment
and activate the env with $ source <venv>/bin/activate (bash) or C:> <venv>/Scripts/activate.bat (Windows)

#### Using conda + pip
Then, install the packages with pip within the activated environment

```bash
cd path_to_your_folder/rl-tutorial-ares-basic
python -m pip install -r requirements.txt
```

Please also run these commands to install `ffmpeg`:
- OS X: `brew install ffmpeg`
- Ubuntu: `sudo apt-get install ffmpeg`
- With pip: `pip install imageio-ffmpeg`

Finally, install the notebook extensions if you want to see them in slide mode:
```bash
conda create -n rl-tutorial python=3.10
conda activate rl-tutorial
pip install -r requirements.txt
jupyter notebook
python -m jupyter contrib nbextension install --user
python -m jupyter nbextension enable varInspector/main
```

- Open the tutorial notebook `tutorial.ipynb` in the jupyter server in browser
- When you are done type `conda deactivate` to deactivate the virtual environment
Now you should be able to run the provided notebook.

## Running the tutorial

#### Using venv
After installing the package

You can start the jupyter notebook in the terminal, and it will start a browser automatically

```bash
python -m venv rl-tutorial
source rl-tutorial/bin/activate
python -m pip install -r requirements.txt
jupyter notebook
python -m jupyter notebook
```

- Open the tutorial notebook `tutorial.ipynb` in the jupyter server in browser
- When you are done type `deactivate`
Alternatively, you can use supported Editor to run the jupyter notebooks, e.g. with VS Code.

---

Expand Down
8 changes: 6 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ cheetah-accelerator
gymnasium
imageio==2.4.1
ipywidgets
jupyterlab
matplotlib
moviepy
names
opencv-python
seaborn
pyyaml
RISE
stable-baselines3
notebook==6.4.12
jupyter_contrib_nbextensions
RISE
traitlets==5.9.0
ipython
ipywidgets

0 comments on commit 2e43ab6

Please sign in to comment.