Compare commits

...

2 Commits

Author SHA1 Message Date
Haodong Duan
7d25759ead
Update gridsearch.py (#84) 2021-12-09 10:03:23 +08:00
Haodong Duan
10f3e61739
Update test_download.py (#85)
Fix Unittest of cifar download
2021-12-09 10:02:42 +08:00
2 changed files with 3 additions and 3 deletions

View File

@ -278,7 +278,7 @@ def gridsearch(
for arg in search_args_dict:
try:
arg_value = get_config(cfg, arg)
if arg_value and not isinstance(arg_value, str):
if arg_value is not None and not isinstance(arg_value, str):
search_args_dict[arg] = [
eval(x) for x in search_args_dict[arg]
]

View File

@ -42,10 +42,10 @@ def test_download():
# mim download mmcls --config resnet18_b16x8_cifar10
checkpoints = download('mmcls', ['resnet18_b16x8_cifar10'])
assert checkpoints == ['resnet18_b16x8_cifar10_20200823-f906fa4e.pth']
assert checkpoints == ['resnet18_b16x8_cifar10_20210528-bd6371c8.pth']
checkpoints = download('mmcls', ['resnet18_b16x8_cifar10'])
# mim download mmcls --config resnet18_b16x8_cifar10 --dest temp_root
with tempfile.TemporaryDirectory() as temp_root:
checkpoints = download('mmcls', ['resnet18_b16x8_cifar10'], temp_root)
assert checkpoints == ['resnet18_b16x8_cifar10_20200823-f906fa4e.pth']
assert checkpoints == ['resnet18_b16x8_cifar10_20210528-bd6371c8.pth']