roboflow / roboflow/roboflow-python

version.model returns NoneType, failing all model inference calls in production

Open
#291 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
629
Forks
140
Avg merge
2d 2h
Merged PRs (30d)
5

Description

Problem

version.model returns NoneType, failing all model inference calls in production

Reproduce steps

Take any public project that has a model:
https://universe.roboflow.com/batuhan-yilmaz-mnu8w/segmentationexample/model/5

Run python inference code:

!pip install roboflow -U # <---- version 1.1.36

from roboflow import Roboflow

rf = Roboflow(api_key="API_KEY")
project = rf.workspace().project("segmentationexample")
model = project.version(5).model

model.predict() # <--- AttributeError: 'NoneType' object has no attribute 'predict'
type(model) # <--- NoneType

Expected behavior

Current workaround is to downgrade roboflow to version 1.1.33

!pip install roboflow==1.1.33

from roboflow import Roboflow

rf = Roboflow(api_key="API_KEY")
project = rf.workspace().project("segmentationexample")
model = project.version(5).model

type(model) # <--- roboflow.models.semantic_segmentation.SemanticSegmentationModel

Potential root cause:

https://github.com/roboflow/roboflow-python/pull/276

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with the project.version(5).model example in the issue, then inspect pull request #276 for the potential root cause. The work is done when version.model returns the appropriate model object instead of NoneType and the documented model.predict() call succeeds on the example project.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.