roboflow / roboflow-python

The official Roboflow Python package. Manage your datasets, models, and deployments. Roboflow has everything you need to build a computer vision application.
https://docs.roboflow.com/python
Apache License 2.0
280 stars 72 forks source link

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

Open by12380 opened 2 months ago

by12380 commented 2 months ago

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