text: 
  
  TITLE
  Resnet weights should not be downloaded when building DETR by from_pretrained
  
  COMMENTS
  5
  
  REACTIONS
  +1: 1
  -1: 0
  laugh: 0
  hooray: 0
  heart: 0
  rocket: 0
  eyes: 0
  
  BODY
  ## Describe the bug
  Hello, the building process of DETR in transformers uses timm to construct a resnet backbone.
  ```
  backbone = create_model(name, pretrained=True, features_only=True, out_indices=(1, 2, 3, 4), **kwargs)
  ```
  However, `pretrained=True` should only be enabled when building an initial DETR. When building DETR with `from_pretrained`, the pretrained weights of Resnet are redundant. If there is a lack of internet connection or a poor network environment, this can cause the code to get stuck even if the model is building from local files.
  
  ## Environment info
  <!-- You can run the command `transformers-cli env` and copy-and-paste its output below.
       Don't forget to fill out the missing fields in that output! -->
  
  - `transformers` version: 4.15.0
  - Platform: Linux-5.11.0-46-generic-x86_64-with-glibc2.17
  - Python version: 3.8.10
  - PyTorch version (GPU?): 1.8.2 (True)
  - Tensorflow version (GPU?): not installed (NA)
  - Flax version (CPU?/GPU?/TPU?): not installed (NA)
  - Jax version: not installed
  - JaxLib version: not installed
  - Using GPU in script?: no
  - Using distributed or parallel set-up in script?: no
  
  Models:
  DETR
  
  
  