A model registry is a tool to catalog ML models and theirs versions. Models from your data science projects can be discovered, tested, shared, deployed, and audited from there. Learn how to build a model registry in a DVC Git repo without involving any extra services, integrations and APIs.
Hai,
when I follow the steps in the blog but I got the following error. Ho can I fix it?
--> gto show --repo REPO
❌ Unexpected error: maximum recursion depth exceeded while calling a Python object
Please report it here running with '--traceback' flag: <https://github.com/iterative/gto/issues>
Hi @RaghavaAlajangi! Thank you for reporting!
I created an issue for this maximum recursion depth exceeded while calling a Python object · Issue #369 · iterative/gto · GitHub
Can you please run gto --traceback show --repo REPO
and post the output there? Thanks!
Hello,
You can start by initializing DVC in your Git repo and organizing folders for datasets, models, and metadata. This Version control your models using dvc add and dvc commit, and maintain metadata files (like JSON) to store model versions, parameters, and performance metrics. Document each model’s details in a README.md for clarity.
There seem to be some problems with this tutorial.
- https urls are no longer supported, and
REPO=git@github.com:{username}/example-get-started.git
should be used. - I get an error that the classifier@v0.0.1 revision is unknown, even though I see the tag listed in the repo.
~/work/example-get-started via 🐍 v3.11.10 (example-get-started)
❯ gto show --repo $REPO
╒═════════════════════╤══════════╤════════╤═════════╤══════════╕
│ name │ latest │ #dev │ #prod │ #stage │
╞═════════════════════╪══════════╪════════╪═════════╪══════════╡
│ classifier │ v0.0.1 │ - │ - │ - │
│ text-classification │ v1.2.0 │ v1.2.0 │ v1.0.0 │ v1.1.0 │
╘═════════════════════╧══════════╧════════╧═════════╧══════════╛
~/work/example-get-started via 🐍 v3.11.10 (example-get-started)
❯ dvc get $REPO model.pkl --rev classifier@v0.0.1 -o model.pkl
ERROR: failed to get 'model.pkl' from 'git@github.com:MyName/example-get-started.git' - unknown Git revision 'classifier@v0.0.1'
As instructed, I did not clone the fork that I created.
GTO 1.7.1, DVC 3.56.0
Any suggestions? Is there a more up to date tutorial for saving models to my own registry/github?
Could you check what Git tags you have on the remote repo? (via UI or Git commands)?
Can you also try to run gto show classifier@latest --ref
- what does it return?
❯ gto show classifier@latest --ref
❌ Unexpected error: . is not a git repository
Please report it here running with '--traceback' flag: <https://github.com/iterative/gto/issues>
Similarly, I can’t use git command to check tags, since I didn’t clone the repo.
The only thing in the folder I am working in is my .venv.
Perhaps I misunderstood the instructions?
I did a clone of my fork and tried there:
example-get-started-cloned on main via 🐍 v3.11.10 (example-get-started-cloned)
❯ REPO=git@github.com:{MyName}/example-get-started.git
example-get-started-cloned on main via 🐍 v3.11.10 (example-get-started-cloned)
❯ dvc get $REPO model.pkl --rev classifier@v0.0.1 -o model.pkl
ERROR: failed to get 'model.pkl' from 'git@github.com:{MyName}/example-get-started.git' - unknown Git revision 'classifier@v0.0.1'
example-get-started-cloned on main via 🐍 v3.11.10 (example-get-started-cloned)
❯ git tag
0-git-init
1-dvc-init
10-bigrams-experiment
11-random-forest-experiments
2-track-data
3-config-remote
4-import-data
5-source-code
6-prepare-stage
7-ml-pipeline
8-dvclive-eval
9-bigrams-model
baseline-experiment
bigrams-experiment
classifier@v0.0.1
random-forest-experiments
text-classification#dev#3
text-classification#prod#1
text-classification#stage#2
text-classification@v1.0.0
text-classification@v1.1.0
text-classification@v1.2.0
You should be running those command within the Git repo, yep. Gto is think wrapper on top of Git tags, so it analyzes (and even runs underneath some git
commands). So, as a rule of thumb - it works in the same env as git
. I hope that clarifies it a bit.
I did a clone of my fork and tried there:
hmm, I can’t reproduce:
(.venv) ?130 Projects/example-get-started % export REPO=git@github.com:shcheklein/example-get-started.git
(.venv) √ Projects/example-get-started % gto register classifier --repo $REPO
Created git tag 'classifier@v0.0.1' that registers version
Running `git push origin classifier@v0.0.1`
Successfully pushed git tag classifier@v0.0.1 on remote.
(.venv) √ Projects/example-get-started % gto show --repo $REPO
╒═════════════════════╤══════════╤════════╤═════════╤══════════╕
│ name │ latest │ #dev │ #prod │ #stage │
╞═════════════════════╪══════════╪════════╪═════════╪══════════╡
│ classifier │ v0.0.1 │ - │ - │ - │
│ text-classification │ v1.2.0 │ v1.2.0 │ v1.0.0 │ v1.1.0 │
╘═════════════════════╧══════════╧════════╧═════════╧══════════╛
(.venv) √ Projects/example-get-started % dvc get $REPO model.pkl --rev classifier@v0.0.1 -o model.pkl