Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix yolov10 version deploy #319

Merged
merged 3 commits into from
Aug 26, 2024
Merged

Fix yolov10 version deploy #319

merged 3 commits into from
Aug 26, 2024

Conversation

grzegorz-roboflow
Copy link
Contributor

Description

Below results in error:

python3.9 -m venv venv
source venv/bin/activate
pip install -e .
import roboflow

rf = roboflow.Roboflow(api_key="<redacted>")

workspace = rf.workspace(the_workspace="<my workspace ID>")
proj = workspace.project(project_id="<my prioject ID>")
version = proj.version(1)

version.deploy(
    model_type="yolov10",
    model_path="/path/to/my_yolov10_dir",
    filename="my_model.pt",
)

Above results in following exception:

Traceback (most recent call last):
  File "/path/to/my_script.py", line 10, in <module>
    version.deploy(
  File "/path/to/roboflow-python/roboflow/core/version.py", line 522, in deploy
    model = torch.load(os.path.join(model_path, filename))
  File "/path/to/roboflow-python/venv/lib/python3.9/site-packages/ultralytics/utils/patches.py", line 86, in torch_load
    return _torch_load(*args, **kwargs)
  File "/path/to/roboflow-python/venv/lib/python3.9/site-packages/torch/serialization.py", line 1097, in load
    return _load(
  File "/path/to/roboflow-python/venv/lib/python3.9/site-packages/torch/serialization.py", line 1525, in _load
    result = unpickler.load()
  File "/path/to/roboflow-python/venv/lib/python3.9/site-packages/torch/serialization.py", line 1515, in find_class
    return super().find_class(mod_name, name)
AttributeError: Can't get attribute 'YOLOv10DetectionModel' on <module 'ultralytics.nn.tasks' from '/path/to/roboflow-python/venv/lib/python3.9/site-packages/ultralytics/nn/tasks.py'>

Type of change

  • Bug fix (non-breaking change which fixes an issue)

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

Executed above-mentioned script from branch with fix applied

Any specific deployment considerations

N/A

Docs

  • Docs updated? Added extra example in main README.md showing how to deploy yolov10 model

@tonylampada tonylampada merged commit e6829fe into main Aug 26, 2024
8 checks passed
@grzegorz-roboflow grzegorz-roboflow deleted the fix-yolov10-version-deploy branch August 26, 2024 15:49
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