From af65737a52c6152f5ac86ee3c0c1edb65f58439f Mon Sep 17 00:00:00 2001 From: XIE Xuan Date: Thu, 2 Nov 2023 08:49:43 +0800 Subject: [PATCH] Shufflenet v2 pretrained (#277) * add two more pretrained models for shufflenet * fix unzip single file --- flowvision/models/shufflenet_v2.py | 4 ++-- flowvision/models/utils.py | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/flowvision/models/shufflenet_v2.py b/flowvision/models/shufflenet_v2.py index fd2c3fce..a5a674a1 100644 --- a/flowvision/models/shufflenet_v2.py +++ b/flowvision/models/shufflenet_v2.py @@ -22,8 +22,8 @@ model_urls = { "shufflenet_v2_x0_5": "https://oneflow-public.oss-cn-beijing.aliyuncs.com/model_zoo/flowvision/classification/ShuffleNetV2/shufflenet_v2_x0_5.zip", "shufflenet_v2_x1_0": "https://oneflow-public.oss-cn-beijing.aliyuncs.com/model_zoo/flowvision/classification/ShuffleNetV2/shufflenet_v2_x1_0.zip", - "shufflenet_v2_x1_5": None, - "shufflenet_v2_x2_0": None, + "shufflenet_v2_x1_5": "https://oneflow-public.oss-cn-beijing.aliyuncs.com/model_zoo/flowvision/classification/ShuffleNetV2/shufflenet_v2_x1_5.zip", + "shufflenet_v2_x2_0": "https://oneflow-public.oss-cn-beijing.aliyuncs.com/model_zoo/flowvision/classification/ShuffleNetV2/shufflenet_v2_x2_0.zip", } diff --git a/flowvision/models/utils.py b/flowvision/models/utils.py index cc18dd82..e1a4c267 100644 --- a/flowvision/models/utils.py +++ b/flowvision/models/utils.py @@ -73,8 +73,6 @@ def _legacy_zip_load(filename, model_dir, map_location, delete_zip_file=True): members = f.infolist() extracted_name = members[0].filename extracted_file = os.path.join(model_dir, extracted_name) - if not os.path.exists(extracted_file): - os.mkdir(extracted_file) f.extractall(model_dir) if delete_zip_file and os.path.exists(filename): os.remove(filename)