使用 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 進行資料版本控管入門