segformer variants
Dear @NielsRogge,

Thanks for re-implementing the `segformer`. I have two questions:

1. The default setting is `segformer-b0`. If I want to use `segformer-b3`, I only need to modify the two parameters: `depths` and `hidden_sizes`, right?

2. I want to use the pre-trained model for small images (256x256), how should I use the `SegformerModel`?

Any comments would be highly appreciated:)

Best regards,
Jun





Hi,

Thanks for your interest in SegFormer! If you want to use the pre-trained model, you can load any checkpoint from the [hub](https://huggingface.co/models?other=segformer), like so:

```
from transformers import SegformerForSemanticSegmentation

model = SegformerForSemanticSegmentation.from_pretrained("nvidia/mit-b3", num_labels=10)
```

This will load only the pre-trained encoder (Mix Transformer or mit), b3-sized, with a randomly initialized head. 

For more details on how to fine-tune SegFormer on your custom data, check out the following resources:
* notebook: https://github.com/NielsRogge/Transformers-Tutorials/blob/master/SegFormer/Fine_tune_SegFormer_on_custom_dataset.ipynb
* blog post (with corresponding notebook): https://huggingface.co/blog/fine-tune-segformer. This one leverages the [Trainer API](https://huggingface.co/docs/transformers/main_classes/trainer).

Regarding the differences between the sizes, [here](https://github.com/huggingface/transformers/blob/277d49a590b6745ec82460eea3f33a825a89051c/src/transformers/models/segformer/convert_segformer_original_to_pytorch.py#L158-L178) you can see the differences.<|||||>Hi @NielsRogge ,

Thanks for your guidance very much:)