THU-MIG / RepViT

RepViT: Revisiting Mobile CNN From ViT Perspective [CVPR 2024] and RepViT-SAM: Towards Real-Time Segmenting Anything
https://arxiv.org/abs/2307.09283
Apache License 2.0
681 stars 55 forks source link

update timm version to support repvit models #35

Closed Isalia20 closed 4 months ago

Isalia20 commented 6 months ago

update timm version to support repvit models, the one in original repo, the timm version in requirements.txt file gives error when trying to run create_model('repvit_m0_9') function

Isalia20 commented 6 months ago

@jameslahm

jameslahm commented 4 months ago

Thank you for your PR! As I know, timm==0.9.12 includes RepViT models, which will be conflict with the ones in this repo. Could you please provide more details about the error when running create_model('repvit_m0_9') function?

Isalia20 commented 4 months ago

Example code:

from timm import create_model

create_model('repvit_m0_9')

with timm==0.5.4 it gives an error:

Traceback (most recent call last):
  File "/home/user/Desktop/detr/temp.py", line 3, in <module>
    create_model('repvit_m0_9')
  File "/home/user/miniconda3/lib/python3.11/site-packages/timm/models/factory.py", line 71, in create_model
    raise RuntimeError('Unknown model (%s)' % model_name)
RuntimeError: Unknown model (repvit_m0_9)
jameslahm commented 4 months ago

You could first register the repvit model and then use it like below:

import model.repvit
from timm.models import create_model
model = create_model('repvit_m0_9')