Import Error for timm with facebook/detr-resnet-50
I am working through implementing the How to Use section from the Facebook Detr Resnet 50 model card here:https://huggingface.co/facebook/detr-resnet-50and am getting the error below when callingDetrForObjectDetection.from_pretrained('facebook/detr-resnet-50').Even after I pip install timm. Any suggestions or help is welcomedImportError                               Traceback (most recent call last)
<ipython-input-41-ec07e43ae43f> in <module>()
----> 1 DetrModel.from_pretrained()

1 frames
/usr/local/lib/python3.7/dist-packages/transformers/file_utils.py in requires_backends(obj, backends)
    681     name = obj.__name__ if hasattr(obj, "__name__") else obj.__class__.__name__
    682     if not all(BACKENDS_MAPPING[backend][0]() for backend in backends):
--> 683         raise ImportError("".join([BACKENDS_MAPPING[backend][1].format(name) for backend in backends]))
    684 
    685 

ImportError: 
DetrModel requires the timm library but it was not found in your environment. You can install it with pip:
`pip install timm`Many thanks!
2021-09-29T07:46:57Z
What is your environment? In Colab notebooks, it might help to restart the runtime.
2021-09-29T12:43:44Z
Thank you! Restarted runtime and voila it works.It was interesting because I could run other timm models and load from timm, butDetrForObjectDetection.from_pretrained('facebook/detr-resnet-50')would throw the error.
2023-10-24T20:48:02Z
I am getting this error in sagemaker,!pip install timm did not helpAny suggestion ?
2023-12-19T07:58:59Z
Hi@payamahv,It’s now possible to use DETR models without relying on the timm dependency. Just pass in revision=“no_timm” to the from_pretrained method:from transformers import DetrForObjectDetection

model = DetrForObjectDetection.from_pretrained("facebook/detr-resnet-50", revision="no_timm")
2024-04-08T11:49:38Z
Hi, did you resolve the issue? I have the same error.