This repository contains code for a Reinforcement Learning agent using a Vision Transformer to solve image classification tasks by active visual exploration.
All commands are run from the project root directory.
# 1. Create virtual environment and activate it
python3 -m venv venv
source venv/bin/activate
# 2. Install dependencies
pip install -r requirements.txt
# 3. Start training
python current_main_script.pyThis command copies your current project folder to the server. You will be prompted for the password.
rsync -avz \
--exclude 'venv' \
--exclude 'checkpoints' \
--exclude 'visualizations' \
--exclude 'wandb' \
--exclude '.git' \
--exclude '.gitignore' \
--exclude '__pycache__' \
--exclude '*.npz' \
-e "ssh" \
. user9@87.242.102.117:~/BionicEyeConnect to the server (ssh user9@87.242.102.117), then run these commands.
# --- First-time setup on server (only need to do this once) ---
cd ~/BionicEye
sudo apt install python3.10-venv -y
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# --- End of setup ---Before starting a new training, check if the GPUs are already in use by someone else.
nvidia-smiLook at the process list at the bottom. If you see other python processes consuming significant GPU memory, it's best to wait or coordinate with your colleagues.
If the server is free and all dependencies are installed, start training interactively.
# Connect to server and start training directly
ssh -t user9@87.242.102.117 "cd ~/BionicEye && source venv/bin/activate && python current_main_script.py"Alternative: Use screen for long-running sessions
If you want to use screen (for sessions you can detach/reattach), start it interactively:
# Connect to server
ssh user9@87.242.102.117
# Create screen session
screen -S training
# Inside screen: activate environment and start training
cd ~/BionicEye
source venv/bin/activate
python current_main_script.py
# To detach from screen (training continues): Ctrl+A, then D
# To reattach later: screen -r trainingScreen commands:
Ctrl+A, D— detach from session (training continues in background)screen -r training— reattach to the training sessionscreen -ls— list all active screen sessionsscreen -S training -X quit— kill the training session
You can safely disconnect from SSH after detaching from screen. The training will continue running on the server.
To copy the generated checkpoints or visualizations from the server back to your local machine, run these commands on your local terminal.
# To download the latest checkpoint:
scp user9@87.242.102.117:~/BionicEye/checkpoints/latest_checkpoint.pth ./checkpoints/
# To download all visualizations:
scp -r user9@87.242.102.117:~/BionicEye/visualizations/ ./visualizations/