Skip to main content
The donkey models command displays a database of your trained models, showing training history, tub data used, and performance metrics.

Usage

Arguments

string
default:"./config.py"
Path to your config.py file
boolean
default:"false"
Group tubs and plot them separately in the output

Description

Donkeycar maintains a database of your training history in the models/ directory. The models command displays:
  • Pilot information - Model names, types, timestamps
  • Training tubs - Which data was used to train each model
  • Performance metrics - Loss values, training duration
  • Model relationships - Transfer learning lineage

Example Output

Output:

Use Cases

1. Track Training Progress

See which models you’ve trained and when:
Helps you:
  • Remember which model performed best
  • Track training experiments
  • See which data was used for each model

2. Audit Data Usage

Verify which tubs contributed to each model:
Useful for:
  • Ensuring balanced training data
  • Tracking down data quality issues
  • Understanding model behavior based on training data

3. Model Management

Identify old models to delete:

Database Location

The model database is stored in:

Information Displayed

Pilot Table

  • Name - Model filename
  • Type - Model architecture (linear, categorical, lstm, etc.)
  • Tubs - Comma-separated list of tub indices used in training
  • Date - Training date
  • Loss - Final validation loss (lower is better)
  • Val Loss - Validation set loss
  • Transfer - Parent model if using transfer learning
  • Comment - User comment added during training

Tub Table

  • Tub - Tub directory name
  • Records - Number of data records
  • Date - Collection date
  • Size - Disk space used
  • Sessions - Number of recording sessions

Using —group Flag

The --group flag organizes the output by grouping tubs together that were used in the same training runs. This makes it easier to see training patterns and data relationships.

Model Database Schema

The database.json file stores training metadata:

Adding Comments to Models

When training, add comments to track experiments:
Comments appear in the database and help you remember model purposes.

Troubleshooting

If the command shows no models:
  • Ensure you’re in your car directory: cd ~/mycar
  • Check models directory exists: ls models/
  • Train a model first with donkey train
  • Database might be corrupted, check models/database.json
If database.json is missing:
  • The database is created during training
  • Train a new model to recreate it
  • Or create empty database: echo '{"pilots": [], "tubs": []}' > models/database.json
If database information is wrong:
  • The database is updated during training, not retroactively
  • Old models trained before database feature won’t appear
  • You can manually edit models/database.json (valid JSON required)

Tips

Name models descriptively - Use meaningful names that indicate track, date, or purpose:
Clean old models regularly - Delete underperforming models to save space:
Track experiments - Always add comments when trying new architectures or training strategies:

Source Code

Implemented in:
  • donkeycar/management/base.py:573-592 - CLI command
  • donkeycar/pipeline/database.py - PilotDatabase class

Further Reading