Nhập môn Quản lý Phiên bản Dữ liệu với DVC
Ravi Bhadauria
Machine Learning Engineer
pip $ pip install dvc
$ dvc version
DVC version: 3.40.1 (pip)Nền tảng: Python 3.9.16 trên macOS-14.2.1-arm64-arm-64bitCấu hình: Global: /Users/<username>/Library/Application Support/dvc System: /Library/Application Support/dvcRepo: dvc, git
$ git init
Đã khởi tạo kho Git trống tại /path/to/repo/.git/
$ dvc init
Đã khởi tạo kho DVC.
Giờ bạn có thể commit các thay đổi vào git.
$ git status
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: .dvc/.gitignore
new file: .dvc/config
new file: .dvcignore
$ git commit -m "initialized dvc"
Tương tự tệp .gitignore
Hữu ích khi có nhiều dữ liệu không cần theo dõi
# .dvcignore # Bỏ qua mọi tệp trong thư mục 'data' data/*# Nhưng không bỏ qua 'data/data.csv' !data/data.csv# Bỏ qua tất cả tệp .tmp *.tmp
dvc check-ignore$ dvc check-ignore data/file.txt
data/file.txt
-d để xem chi tiết$ dvc check-ignore -d data/file.txt
.dvcignore:3:data/* data/file.txt
pip install dvcdvc versiondvc init.dvcignore dùng để chỉ định tệp loại trừ.gitignore, cùng cú phápdvc check-ignore <filename>Nhập môn Quản lý Phiên bản Dữ liệu với DVC