Skip to content

Conversation

mattdangerw
Copy link
Member

Let's get rid of load_task_extras, which is a bad and confusing name. Instead, we will adopt some behavior that is specific to classifiers, but a lot simpler.

# Random head.
classifier = ImageClassifier.from_preset("resnet50", num_classes=2)
# Pretrained head.
classifier = ImageClassifier.from_preset("resnet50")
# Error, must provide num_classes.
classifier = TextClassifier.from_preset("bert_base_en")

Let's get rid of `load_task_extras`, which is a bad and confusing name.
Instead, we will adopt some behavior that is specific to classifiers,
but a lot simpler.

```python
# Random head.
classifier = ImageClassifier.from_preset("resnet50", num_classes=2)
# Pretrained head.
classifier = ImageClassifier.from_preset("resnet50")
# Error, must provide num_classes.
classifier = TextClassifier.from_preset("bert_base_en")
```
Copy link
Member

@SamanehSaadat SamanehSaadat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Matt!
Just left some nit comments!

@mattdangerw mattdangerw merged commit 29818cb into keras-team:master Sep 12, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kokoro:force-run Runs Tests on GPU
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants