Impossible to guess which feature extractor to use. Please provide a PreTrainedFeatureExtractor class or a path/identifier to a pretrained feature extractor.

Ask Questions Forum: ask Machine Learning Questions to our readersCategory: Other frameworkImpossible to guess which feature extractor to use. Please provide a PreTrainedFeatureExtractor class or a path/identifier to a pretrained feature extractor.
Chris Staff asked 3 weeks ago

What to do when this issue appears?

1 Answers
Best Answer
Chris Staff answered 3 weeks ago

It’s likely that you are using a custom model for object detection in a HuggingFace pipeline. You will need to specify the feature extractor explicitly, like so:


# Initialize another model and feature extractor
feature_extractor = DetrFeatureExtractor.from_pretrained('facebook/detr-resnet-101')
model = DetrForObjectDetection.from_pretrained('facebook/detr-resnet-101')

# Initialize the object detection pipeline
object_detector = pipeline("object-detection", model = model, feature_extractor = feature_extractor)

Your Answer

12 + 9 =