Browse Source
Adapt get_pretrained_cfg with towhee of lower version
Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
1 changed files with
14 additions and
7 deletions
-
isc.py
|
@ -30,7 +30,14 @@ import torch |
|
|
from torch import nn |
|
|
from torch import nn |
|
|
from PIL import Image as PILImage |
|
|
from PIL import Image as PILImage |
|
|
from timm.data import create_transform |
|
|
from timm.data import create_transform |
|
|
from timm.models import create_model, get_pretrained_cfg |
|
|
|
|
|
|
|
|
from timm import create_model |
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|
|
from timm.models import get_pretrained_cfg |
|
|
|
|
|
except ImportError: |
|
|
|
|
|
from timm.models.registry import _model_default_cfgs |
|
|
|
|
|
def get_pretrained_cfg(model_name): |
|
|
|
|
|
return _model_default_cfgs[model_name] |
|
|
|
|
|
|
|
|
warnings.filterwarnings('ignore') |
|
|
warnings.filterwarnings('ignore') |
|
|
log = logging.getLogger('isc_op') |
|
|
log = logging.getLogger('isc_op') |
|
|