Description
Remove experiments from your DVC project. This command deletes experiment references and associated data, helping you clean up unsuccessful experiments or maintain a tidy experiment history. You can remove individual experiments, all experiments from specific commits, or queued experiments.Usage
dvc exp rm
Arguments
string[]
One or more experiment names to remove. Can specify multiple experiments separated by spaces.
Options
Selection Options
string[]
Remove all experiments from the specified Git revisions. Can be used multiple times.
boolean
default:"false"
Remove experiments from all Git commits.
integer
default:"1"
Remove experiments from the last N commits. Used with
--rev or --all-commits.boolean
default:"false"
Remove all queued experiments (experiments staged with
dvc exp run --queue but not yet executed).integer
Keep the N most recent experiments and remove the rest. Must be used with
--rev or --all-commits.string
Name or URL of the Git remote to remove the experiment from. This removes experiments from a remote repository.
Examples
Remove a single experiment
Removing an experiment deletes its reference and cached data, but doesn’t affect any Git branches created from it.
Remove multiple experiments
Remove all experiments from current commit
Remove all queued experiments
This only removes queued experiments that haven’t been executed yet.
Remove experiments from multiple branches
Keep only recent experiments
Remove from last N commits
Remove all experiments
Remove from remote repository
This removes the experiment from the remote Git repository, not just your local copy.
Common Workflows
Clean up failed experiments
Maintain experiment history limit
Cancel queued experiments
Clean up before archiving
Remove experiments after promotion
Removing an experiment doesn’t affect Git branches created from it using
dvc exp branch.Understanding Removal Scope
What Gets Removed
- Experiment references: Entries in DVC’s experiment database
- Cached data: Model outputs and artifacts unique to the experiment
- Metrics history: Historical metrics recorded for the experiment
- Parameter snapshots: Parameter values used in the experiment
What Doesn’t Get Removed
- Git branches: Branches created via
dvc exp branchremain intact - Shared cache: Data shared with other experiments or commits
- Git commits: Regular Git commits are unaffected
- Current workspace: Your working directory remains unchanged
DVC uses reference counting for cached data. Removing an experiment only deletes data that’s not referenced by other experiments or commits.
Validation and Safety
Confirm before removal
Remove with filtering
Backup before bulk removal
Troubleshooting
No experiments to remove
This means there are no experiments associated with the specified revision.
Experiment not found
Cannot remove from remote
Related Commands
dvc exp show- View experiments before removingdvc exp run- Create new experimentsdvc exp branch- Convert experiment to permanent branch before removingdvc gc- Clean up unused cache data (after removing experiments)