8000 orbis/training at main · OrbisVL/orbis · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History

training

README.md

Training Setup

This folder contains the notebook and dependencies for fine-tuning Qwen2.5-VL-3B-Instruct on VRSBench.

The goal of this guide is to make setup on a new machine predictable:

  • create the uv environment
  • install the pinned dependencies
  • download the model
  • download the dataset
  • extract the image archives into the expected folder layout
  • run the notebook without path surprises

Expected Folder Layout

After setup, the important parts of training/ should look like this:

training/
  pyproject.toml
  uv.lock
  README.md
  VRS Finetune.ipynb
  models/
    qwen2.5-vl-3b/
      config.json
      model.safetensors.index.json
      model-00001-of-00002.safetensors
      model-00002-of-00002.safetensors
      ...
  VRSBench/
    VRSBench_train.json
    VRSBench_EVAL_Cap.json
    VRSBench_EVAL_vqa.json
    VRSBench_EVAL_referring.json
    Images_train/
      00002_0000.png
      ...
    Images_val/
      05863_0000.png
      ...

1. Create The uv Environment

From the training/ folder:

uv venv --python 3.12
uv sync

If you are starting from scratch on a new machine and uv has not created the project yet, this repo already includes pyproject.toml, so you do not need uv init.

If you ever do want to scaffold a fresh project manually, the usual pattern is:

uv init
uv venv --python 3.12
uv sync

For this repo, the normal command sequence is just:

cd training
uv venv --python 3.12
uv sync

2. Verify The Environment

These checks help catch the common setup issues early.

uv run python -c "import torch; print(torch.__version__); print(torch.cuda.is_available()); print(torch.version.cuda)"
uv run python -c "import bitsandbytes as bnb; print(getattr(bnb, '__version__', 'unknown'))"

If CUDA is working, the first command should report:

  • a CUDA build of PyTorch such as 2.11.0+cu130
  • True for torch.cuda.is_available()

3. Download The Base Model

The notebook looks for the model here by default:

training/models/qwen2.5-vl-3b/

Download the full model snapshot into that folder:

uv run hf download Qwen/Qwen2.5-VL-3B-Instruct --local-dir .\models\qwen2.5-vl-3b

If the folder already exists but is incomplete, remove it first and redownload:

Remove-Item -Recurse -Force .\models\qwen2.5-vl-3b
uv run hf download Qwen/Qwen2.5-VL-3B-Instruct --local-dir .\models\qwen2.5-vl-3b

Quick check:

Get-ChildItem .\models\qwen2.5-vl-3b\model-*.safetensors

You should see at least:

  • model-00001-of-00002.safetensors
  • model-00002-of-00002.safetensors

4. Download The Dataset

The notebook looks for the dataset here by default:

training/VRSBench/

Download the dataset repo into that folder:

uv run hf download xiang709/VRSBench --repo-type dataset --local-dir .\VRSBench

That should give you files like:

  • VRSBench_train.json
  • VRSBench_EVAL_Cap.json
  • VRSBench_EVAL_vqa.json
  • VRSBench_EVAL_referring.json
  • Images_train.zip
  • Images_val.zip

5. Extract The Dataset Images

The notebook expects extracted image folders, not only the zip files.

Run:

Expand-Archive .\VRSBench\Images_train.zip .\VRSBench\Images_train
Expand-Archive .\VRSBench\Images_val.zip .\VRSBench\Images_val

Important:

  • After extraction, the image files should sit directly inside Images_train/ and Images_val/.
  • If the zip creates a nested folder like Images_train\Images_train\..., move the files one level up so the final layout is:
VRSBench/
  Images_train/
    00002_0000.png
  Images_val/
    05863_0000.png

Quick checks:

Get-ChildItem .\VRSBench\Images_train | Select-Object -First 5 Name
Get-ChildItem .\VRSBench\Images_val | Select-Object -First 5 Name

6. Start Jupyter

From training/:

u
49DC
v run jupyter lab

Then open:

training/VRS Finetune.ipynb

Run the notebook from the top.

7. Optional Environment Overrides

The notebook supports these environment variables:

  • QWEN_VL_MODEL_PATH: override model directory or use a Hugging Face model id
  • VRS_DATASET_DIR: override the local VRSBench directory
  • VRS_OUTPUT_DIR: override checkpoint/adapter output directory
  • HF_HOME: override the Hugging Face cache directory

Example:

$env:VRS_DATASET_DIR="D:\\datasets\\VRSBench"
$env:QWEN_VL_MODEL_PATH="D:\\models\\qwen2.5-vl-3b"
uv run jupyter lab

8. One-Shot Setup Checklist

From training/, the smooth setup path is:

uv venv --python 3.12
uv sync
uv run hf download Qwen/Qwen2.5-VL-3B-Instruct --local-dir .\models\qwen2.5-vl-3b
uv run hf download xiang709/VRSBench --repo-type dataset --local-dir .\VRSBench
Expand-Archive .\VRSBench\Images_train.zip .\VRSBench\Images_train
Expand-Archive .\VRSBench\Images_val.zip .\VRSBench\Images_val
uv run jupyter lab

Before training, confirm:

  • model shard files exist
  • VRSBench_train.json exists
  • Images_train/ contains .png files
  • Images_val/ contains .png files
  • uv run python -c "import torch; print(torch.cuda.is_available())" prints True

9. Common Problems

FileNotFoundError: model-00001-of-00002.safetensors

  • The model download is incomplete.
  • Redownload Qwen/Qwen2.5-VL-3B-Instruct into training/models/qwen2.5-vl-3b/.

FileNotFoundError: Could not locate image '....png'

  • The image archives were not extracted, or they extracted into a nested folder.
  • Flatten Images_train/ and Images_val/ so the .png files are directly inside them.

bitsandbytes compiled without GPU support

  • Upgrade bitsandbytes and re-run uv sync.
  • Verify that the environment includes the correct CUDA DLL for your PyTorch/CUDA build.

torch.cuda.is_available() is False

  • The current Python environment is not using the CUDA-enabled PyTorch build.
  • Re-run uv sync in this folder and make sure the notebook kernel is using training/.venv.
0