Skip to content

fix: migrate version.model usage to version.models() for roboflow 1.4.0 - #448

Draft
mkaic wants to merge 1 commit into
mainfrom
claude/fix-roboflow-1-4-0-version-model
Draft

fix: migrate version.model usage to version.models() for roboflow 1.4.0#448
mkaic wants to merge 1 commit into
mainfrom
claude/fix-roboflow-1-4-0-version-model

Conversation

@mkaic

@mkaic mkaic commented Jul 23, 2026

Copy link
Copy Markdown

Note

Code and PR description are LLM-written. Code has been reviewed and tested in staging by Kai

Why

roboflow-python 1.4.0 (the MMPV release — a dataset version can now own multiple trained models) deprecated the singular version.model attribute in favor of version.models(). Two consequences for this repo:

  1. Deprecation noise: every notebook that touches version.model now prints a DeprecationWarning to users.
  2. Latent breakage: version.model is derived from the model field on the project payload's version entry, which is absent for versions whose models were trained through the v2 trainings pipeline. For those versions version.model returns None even when trained models exist (verified against staging: 1.3.13 returns a working model object for kaiplace/the-paid-gallery/187, 1.4.0 returns None, while version.models() correctly lists 5 models). The demo versions these notebooks point at are legacy-trained, so they still work today — but they will break silently (assert model, "Model deployment is still loading") once retrained through the new pipeline, and the pattern already breaks for any user following along with their own v2-trained version.

What

Migrates the three unpinned notebooks that used version.model to the new canonical version.models() API (newest model first; TrainedModel supports the same .predict() / .predict_video() / .poll_until_video_results() calls):

  • notebooks/train-yolov8-keypoint.ipynb
  • notebooks/train-yolov8-classification-on-custom-dataset.ipynb
  • notebooks/roboflow_video_inference_with_custom_annotators.ipynb

Outputs of the edited cells were cleared (they showed output from the old API, including the since-fixed prediction_type: 'ClassificationModel' mislabel on keypoint predictions).

Not touched: notebooks pinned to roboflow==1.1.48/1.1.49 (insulated from 1.4.0), and train-package-detector-two-labeled-images.ipynb (version.train() still works unchanged).

Related

The higher-leverage fix is arguably in roboflow-python itself: the deprecated version.model shim could fall back to the v2 surface when the legacy payload field is missing, which would un-break all existing content (docs, blogs, customer code) rather than just this repo.

🤖 Generated with Claude Code

roboflow-python 1.4.0 deprecated the singular version.model attribute
(MMPV: a version can now own multiple models) and it can return None for
versions whose models were trained through the v2 trainings pipeline.
Switch the three unpinned notebooks that used it to version.models(),
which lists every trained model for the version, newest first.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant