mpeb / KAGGLE_FIX.md
jeyanthangj2004's picture
Upload 21 files
558d0f4 verified

Kaggle Read-Only File System Fix

Problem

OSError: [Errno 30] Read-only file system: '/kaggle/input/yolo-mpeb-training-code/code/datasets'

Root Cause

In Kaggle:

  • /kaggle/input/ is READ-ONLY (contains your uploaded datasets)
  • /kaggle/working/ is WRITABLE (for outputs and temporary files)

The dataset YAML was trying to download/create files in /kaggle/input/, which is not allowed.

Solution

βœ… Fixed Files

  1. dataset_example.yaml - Changed dataset path

    # Before (WRONG):
    path: VisDrone
    
    # After (CORRECT):
    path: /kaggle/working/VisDrone
    
  2. train_kaggle.py - New Kaggle-specific training script

    • Properly handles Kaggle paths
    • Copies files from /kaggle/input/ to /kaggle/working/
    • Sets up training in writable directory
  3. kaggle_training_notebook.ipynb - Ready-to-use Kaggle notebook

    • Complete training workflow
    • Validation and testing cells
    • Visualization of results
  4. KAGGLE_SETUP.md - Comprehensive setup guide

    • Step-by-step instructions
    • Troubleshooting tips
    • Path explanations

How to Use

Option 1: Use the Notebook (Recommended)

  1. Upload all files to a Kaggle dataset
  2. Create a new Kaggle notebook
  3. Add your dataset as input
  4. Upload kaggle_training_notebook.ipynb
  5. Run all cells

Option 2: Use the Python Script

  1. Upload all files to a Kaggle dataset
  2. Create a new Kaggle notebook
  3. Run:
    import shutil
    shutil.copy('/kaggle/input/yolo-mpeb-training-code/code/train_kaggle.py', 
                '/kaggle/working/train_kaggle.py')
    !python /kaggle/working/train_kaggle.py
    

Key Changes Summary

File Change Reason
dataset_example.yaml path: VisDrone β†’ path: /kaggle/working/VisDrone Use writable directory
train_kaggle.py New file Kaggle-specific paths and setup
kaggle_training_notebook.ipynb New file Easy-to-use notebook template
KAGGLE_SETUP.md New file Documentation and troubleshooting

Verification

After the fix, training should start successfully:

Ultralytics 8.3.239 πŸš€ Python-3.11.13 torch-2.6.0+cu124 CUDA:0 (Tesla P100-PCIE-16GB, 16269MiB)
engine/trainer: ...
Downloading VisDrone dataset to /kaggle/working/VisDrone...
Training starting...

Important Notes

  1. Dataset Download: First run will download ~2.3 GB VisDrone dataset
  2. Training Time: ~6-8 hours on Tesla P100
  3. Save Outputs: Download weights before closing notebook
  4. GPU Required: Enable GPU in Kaggle settings

Files to Upload to Kaggle Dataset

Upload these files to your Kaggle dataset:

  • βœ… yolov8_mpeb.yaml - Model architecture
  • βœ… yolov8_mpeb_modules.py - Custom modules
  • βœ… dataset_example.yaml - Dataset config (FIXED)
  • βœ… train_kaggle.py - Training script (NEW)

Quick Test

To verify the fix works, run this in a Kaggle notebook:

import yaml
with open('/kaggle/input/yolo-mpeb-training-code/code/dataset_example.yaml') as f:
    config = yaml.safe_load(f)
    print(f"Dataset path: {config['path']}")
    # Should print: /kaggle/working/VisDrone

Support

If you still get errors:

  1. Check that dataset path is /kaggle/working/VisDrone
  2. Verify GPU is enabled
  3. Ensure all files are in your Kaggle dataset
  4. Check the KAGGLE_SETUP.md for detailed troubleshooting