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

YOLOV8Detector.from_preset docstring is incorrect #1986

Open
blair-ahlquist opened this issue Jul 28, 2023 · 4 comments
Open

YOLOV8Detector.from_preset docstring is incorrect #1986

blair-ahlquist opened this issue Jul 28, 2023 · 4 comments
Assignees
Labels
stat:contributions welcome type:docs Improvements or additions to documentation

Comments

@blair-ahlquist
Copy link

I get a TypeError when calling YOLOV8Detector.from_preset:


TypeError Traceback (most recent call last)
Cell In[4], line 1
----> 1 model = keras_cv.models.YOLOV8Detector.from_preset("resnet50_imagenet")
3 println(model)

File c:\Users\Blair\AppData\Local\Programs\Python\Python39\lib\site-packages\keras_cv\models\task.py:189, in Task.init_subclass..from_preset(calling_cls, *args, **kwargs)
188 def from_preset(calling_cls, *args, **kwargs):
--> 189 return super(cls, calling_cls).from_preset(*args, **kwargs)

File c:\Users\Blair\AppData\Local\Programs\Python\Python39\lib\site-packages\keras_cv\models\task.py:136, in Task.from_preset(cls, preset, load_weights, **kwargs)
132 backbone_cls = keras.saving.get_registered_object(
133 metadata["class_name"]
134 )
135 backbone = backbone_cls.from_preset(preset, load_weights)
--> 136 return cls(backbone, **kwargs)
138 # Otherwise must be one of class presets
139 config = metadata["config"]

TypeError: init() missing 2 required positional arguments: 'num_classes' and 'bounding_box_format'

@jbischof
Copy link
Contributor

@blair-ahlquist you need to provide those two arguments along with the preset name to fully specify the model architecture. See our OD guide for more details.

@blair-ahlquist
Copy link
Author

Ok. I was following the example listed here.

@jbischof
Copy link
Contributor

Good point, we should update the docstring! Feel free to submit a PR or we will get to it eventually.

@ianstenbit ianstenbit changed the title TypeError when calling from_preset YOLOV8Detector.from_preset docstring is incorrect Aug 4, 2023
@ianstenbit
Copy link
Contributor

ianstenbit commented Aug 4, 2023

Thanks for finding this issue! Ramesh is going to update the docstring

@sachinprasadhs sachinprasadhs added the type:docs Improvements or additions to documentation label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:contributions welcome type:docs Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

5 participants