提交 e3ca763d 编写于 作者: W WuHaobo

polish download pretrain

上级 6675cf43
......@@ -16,8 +16,6 @@ import architectures
import types
from difflib import SequenceMatcher
from ppcls.utils.config import get_config
def get_architectures():
"""
......@@ -30,13 +28,6 @@ def get_architectures():
return names
def get_pretrained():
"""
get all of model pretrained
"""
return get_config('./pretrained.list')
def similar_architectures(name='', names=[], thresh=0.1, topk=10):
"""
inferred similar architectures
......
......@@ -20,7 +20,6 @@ import sys
import paddle.fluid as fluid
from ppcls.modeling import get_architectures
from ppcls.modeling import similar_architectures
from ppcls.utils import logger
......
......@@ -23,9 +23,9 @@ import tarfile
import tqdm
import zipfile
from ppcls.modeling import get_pretrained
from ppcls.modeling import similar_architectures
from ppcls.utils.check import check_architecture
from ppcls.utils.config import get_config
from ppcls.utils import logger
__all__ = ['get']
......@@ -172,7 +172,7 @@ def _decompress(fname):
def _check_pretrained_name(architecture):
assert isinstance(architecture, str), \
("the type of architecture({}) should be str". format(architecture))
similar_names = similar_architectures(architecture, get_pretrained())
similar_names = similar_architectures(architecture, get_config('../../../configs/pretrained.list'))
model_list = ', '.join(similar_names)
err = "{} is not exist! Maybe you want: [{}]" \
"".format(architecture, model_list)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册