# Convert Pretrained Models This document provides a brief intro of how to convert the pretrained model into the format of detrex. ## Convert TorchVision Pretrained ResNet Models To use the detectron2 provided pretrained weights, please refer to [ImageNet Pretrained Models](https://github.com/facebookresearch/detectron2/blob/main/MODEL_ZOO.md#imagenet-pretrained-models). Here we've noticed that detectron2 only provided a converted torchvision `ResNet-50` model. For more pretrained models like `ResNet{101, 152}`. You can use the detectron2 provided [conversion script](https://github.com/facebookresearch/detectron2/blob/main/tools/convert-torchvision-to-d2.py) to convert the torchvision pretrained weights into the format that can be used in `detrex`. Here's the detailed tutorial about the usage the conversion script. ### Download Pretrained Weights `Torchvision 0.11.0` was released packed with better pretrained weights on numerous models including `ResNet`. More details can be found in [How to Train State-Of-The-Art Models Using TorchVision’s Latest Primitives](https://pytorch.org/blog/how-to-train-state-of-the-art-models-using-torchvision-latest-primitives/), here we collected the download scripts for TorchVision `ResNet` models.
| Name | Download | Pretrain | Acc@1 | Acc@5 |
|---|---|---|---|---|
| ResNet-50 (ImageNet1k-V1) | script |
IN1k | 76.130 | 92.862 |
| ResNet-50 (ImageNet1k-V2) | script |
IN1k | 80.858 | 95.434 |
| ResNet-101 (ImageNet1k-V1) | script |
IN1k | 77.374 | 93.546 |
| ResNet-101 (ImageNet1k-V2) | script |
IN1k | 81.886 | 95.780 |
| ResNet-152 (ImageNet1k-V1) | script |
IN1k | 78.312 | 94.046 |
| ResNet-152 (ImageNet1k-V2) | script |
IN1k | 82.284 | 96.002 |