donkey models command displays a database of your trained models, showing training history, tub data used, and performance metrics.
Usage
Arguments
Path to your config.py file
Group tubs and plot them separately in the output
Description
Donkeycar maintains a database of your training history in themodels/ 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
Use Cases
1. Track Training Progress
See which models you’ve trained and when:- 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:- 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
--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
Thedatabase.json file stores training metadata:
Adding Comments to Models
When training, add comments to track experiments:Troubleshooting
No models found
No models found
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
Database file not found
Database file not found
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
Incorrect or missing information
Incorrect or missing information
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)
Related Commands
donkey train- Train models (creates database entries)donkey tubplot- Compare model predictionsdonkey makemovie- Visualize model performance
Tips
Source Code
Implemented in:donkeycar/management/base.py:573-592- CLI commanddonkeycar/pipeline/database.py- PilotDatabase class
