Predictive RNNs
There are some extra steps in managing the requirements needed for the Predictive RNN project. This guide should help you get everything set up on Misha.
- Ensure you have an account on Misha, and log on.
- Make sure you're running a compute node. If you're in a normal terminal/SSH session, you can start an interactive session with e.g.
salloc -t 2:00:00. If are using the VS Code Proxy (as described on the vs_code.md page), you're already on a compute node. - Make sure you've also set up SSH cloning from the cluster, because you'll need to clone repositories into your storage. We're using SSH clone links from here out.
- See the page on HPCs for more information on this.
- Make sure you're running a compute node. If you're in a normal terminal/SSH session, you can start an interactive session with e.g.
- Clone the
pRNNpackage into yourprojectfolder. This is accessible by typingcd ~/../../project/levenstein/YOUR_NETID/. This brings you to the/gpfs/radev/project/levenstein/YOUR_NETID.git clone git@github.com:LevensteinLab/pRNN.git- 👁️ Watch the repository so you can be notified of any updates!
- Also clone the following repository into that project directory:
- Farama Foundation version of minigrid. This is the most up-to-date version. (
git clone git@github.com:Farama-Foundation/Minigrid.git)
- Farama Foundation version of minigrid. This is the most up-to-date version. (
- Create a conda environment with Python 3.9.
- Misha doesn't come with Python 3.9 out of the box, and we need this version for later dependencies.
- Type
module load minicondato ensure conda is loaded for use. - Run
conda create -n prnn_tutorial python=3.9to make an environment calledprnn_tutorialwith python 3.9 installed. - Activate it (
conda activate prnn_tutorial).
- In the project folder, create your own separate repo for your work. We recommend using a template such as Patrick Mineault's
true-neutral-cookiecutterto model the repository after.pip install cookiecuttercookiecutter gh:patrickmineault/true-neutral-cookiecutter- It will prompt you for input regarding the name of the repository.
- Now, we need to populate our environment with the correct packages. Some of them depend on an older version of pip, so it's important to do the steps in order. Run the following commands:
pip install "pip<24.1" setuptools==59.5.0 wheel==0.37.0pip install gym==0.21.0 --no-binary gympip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 --no-cache-dir
- We'll also need to install the external repository from step 3 into environment.
pip3 install -e ~/../../project/levenstein/YOUR_NETID/Minigrid
- Install the
pRNNpackage itself into the environment.- Navigate to the repository, then
pip install -e .
- Navigate to the repository, then
- Make sure that the jupyter notebook kernel can recognize this environment.
pip install ipykernel- Run
ipython kernel install --user --name=prnn_tutorial. To allow jupyter notebooks to pick it up. - If you run
jupyter kernelspec list, you should seeprnn_tutorialas an option. - You may need to restart your VSCode or kernel here.
- If you're on VSCode, you can do this fast with
Cmd + Shift + Pto open the Command Palette and thenDeveloper: Reload Window.
- If you're on VSCode, you can do this fast with
- Your environment should be all set to run example code provided with the package, or to start going through the tutorials. The quickstart tutorial can be found here. This contains an example training run.
- If you would like to run through quickstart interactively, you will need to copy
pRNN/examples/tutorial.ipynbto yourprnn_tutorialfolder. This can be done withrsync -r ../pRNN/examples/ .
- If you would like to run through quickstart interactively, you will need to copy