logo
Browse Source

Adapt get_pretrained_cfg with towhee of lower version

Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
Jael Gu 2 years ago
parent
commit
42ea1659f5
  1. 9
      isc.py

9
isc.py

@ -30,7 +30,14 @@ import torch
from torch import nn
from PIL import Image as PILImage
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')
log = logging.getLogger('isc_op')

Loading…
Cancel
Save