DVC 数据版本管理入门
Ravi Bhadauria
Machine Learning Engineer
.dvc 目录内$ dvc cache dir ~/mycache

$ dvc add data.csv
100% Adding...|====================|1/1 [00:00, 53.55file/s]
To track the changes with git, run:
git add data.csv.dvc
To enable auto staging, run:
dvc config core.autostage true
每个 DVC 跟踪的文件都有对应的 .dvc 文件
data.csv -> data.csv.dvc要为数据文件建版本,用 git commit -m "data.csv.dvc"
.dvc 文件的内容
outs:- md5: f38a850818377e97155d22755caa39d0size: 16hash: md5path: data.csv
$ find .dvc/cache -type f
.dvc/cache/f3/8a850818377e97155d22755caa39d0
$ md5 data.csv
MD5 (data.csv) = f38a850818377e97155d22755caa39d0
dvc add -v 获取详细输出
dvc remove 移除已添加的文件$ dvc remove data.csv.dvc
dvc gc-w 删除工作区缓存$ dvc gc -w
WARNING: This will remove all cache except items used in the workspace of the current repo.
Are you sure you want to proceed? [y/n]: y
Removed 1 objects from repo cache.
dvc cache dir ~/mycachedvc add data.csv.dvc 文件dvc remove data.csv.dvcdvc gc -w 清理工作区缓存DVC 数据版本管理入门