Is there any way to change parameters in pretrained DetrFeatureExtractor?
For my model, I load pretrained version of DetrFeatureExtractor:
feature_extractor = DetrFeatureExtractor(return_tensors=&quot;pt&quot;
                                        ,do_normalize = True
                                        ,size = 400).from_pretrained(&quot;facebook/detr-resnet-50&quot;)

But when I output parameters of this variable, I get:
DetrFeatureExtractor {
  &quot;do_normalize&quot;: true,
  &quot;do_resize&quot;: true,
  &quot;feature_extractor_type&quot;: &quot;DetrFeatureExtractor&quot;,
  &quot;format&quot;: &quot;coco_detection&quot;,
  &quot;image_mean&quot;: [
    0.485,
    0.456,
    0.406
  ],
  &quot;image_std&quot;: [
    0.229,
    0.224,
    0.225
  ],
  &quot;max_size&quot;: 1333,
  &quot;size&quot;: 800
}

which still has size = 800. Is that possible to change parameters of pretrained feature extractor and, if yes, how can I change them?

Your values to the constructor are not taken, because you are calling .from_pretrained(), which loads all values from the respective config file of the pretrained model (in your case, the corresponding config file can be viewed here).
Even if some values might not be specified in the config, they will be primarily taken from the default values, instead of whatever you're passing before.
If you want to change attributes, you can do so after loading:
from transformers import DetrFeatureExtractor

model = DetrFeatureExtractor.from_pretrained(&quot;facebook/detr-resnet-50&quot;)
model.size = 400
print(model)  # will show the correct size

I do want to point out that changing parameters of pretrained networks might lead to unexpected behavior - after all, the model wasn't originally trained with this particular setting. So just be aware that this might lead to detrimental performance, and experiment at your own risk ;-)
