Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

tonylampada
Copy link
Collaborator

@tonylampada tonylampada commented Aug 11, 2025

Description

The devx for training over the API was very broken. A simple snippet like below doesn't work.
Nick uncovered this bug because Pella was bitten. Slack thread

This is one of those cases that just to debug, I had had to refactor first.

What actually solved the bug is:

  • adding nocache=true to api calls
  • waiting for version to have generating=False AND images>0 to consider it generated. Otherwise you can run into a very likely racing condition where the train endpoint finds a version that still looks empty.
    rf = Roboflow()
    project = rf.workspace("meh3").project("mosquitobao")
    version_number = project.generate_version(
        settings={
            "augmentation": {
                "bbblur": {"pixels": 1.5},
                "image": {"versions": 2},
            },
            "preprocessing": {
                "auto-orient": True,
            },
        }
    )
    # version_number = "61"
    print(version_number)
    version = project.version(version_number)
    model = version.train(
        speed="fast",  # Options: "fast" (default) or "accurate" (paid feature)
        checkpoint=None,  # Use a specific checkpoint to continue training
    )
    print(model)

Type of change

  • Maintenance (non-breaking, non-user facing changing such as dependency update, adding test, modifying secrets, etc.)
  • Bugfix

How has this change been tested, please provide a testcase or example of how you tested the change?

  • Tested locally with the debugme.py file

@tonylampada tonylampada self-assigned this Aug 11, 2025
@digaobarbosa digaobarbosa merged commit f561f05 into main Aug 12, 2025
14 checks passed
@iurisilvio iurisilvio deleted the tony/bugfix-train-racing branch August 27, 2025 12:40
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.

2 participants