未验证 提交 02239eba 编写于 作者: J Jason 提交者: GitHub

Merge pull request #302 from FlyingQianMM/develop_ui

paddlex gui 1.1.6
......@@ -203,30 +203,30 @@ def get_pretrain_weights(flag, class_name, backbone, save_dir):
backbone)
# if backbone == 'AlexNet':
# url = image_pretrain[backbone]
# fname = osp.split(url)[-1].split('.')[0]
# paddlex.utils.download_and_decompress(url, path=new_save_dir)
# return osp.join(new_save_dir, fname)
try:
logging.info(
"Connecting PaddleHub server to get pretrain weights...")
hub.download(backbone, save_path=new_save_dir)
except Exception as e:
logging.error(
"Couldn't download pretrain weight, you can download it manualy from {} (decompress the file if it is a compressed file), and set pretrain weights by your self".
format(image_pretrain[backbone]),
exit=False)
if isinstance(e, hub.ResourceNotFoundError):
raise Exception("Resource for backbone {} not found".format(
backbone))
elif isinstance(e, hub.ServerConnectionError):
raise Exception(
"Cannot get reource for backbone {}, please check your internet connection"
.format(backbone))
else:
raise Exception(
"Unexpected error, please make sure paddlehub >= 1.6.2")
return osp.join(new_save_dir, backbone)
url = image_pretrain[backbone]
fname = osp.split(url)[-1].split('.')[0]
paddlex.utils.download_and_decompress(url, path=new_save_dir)
return osp.join(new_save_dir, fname)
#try:
# logging.info(
# "Connecting PaddleHub server to get pretrain weights...")
# hub.download(backbone, save_path=new_save_dir)
#except Exception as e:
# logging.error(
# "Couldn't download pretrain weight, you can download it manualy from {} (decompress the file if it is a compressed file), and set pretrain weights by your self".
# format(image_pretrain[backbone]),
# exit=False)
# if isinstance(e, hub.ResourceNotFoundError):
# raise Exception("Resource for backbone {} not found".format(
# backbone))
# elif isinstance(e, hub.ServerConnectionError):
# raise Exception(
# "Cannot get reource for backbone {}, please check your internet connection"
# .format(backbone))
# else:
# raise Exception(
# "Unexpected error, please make sure paddlehub >= 1.6.2")
#return osp.join(new_save_dir, backbone)
elif flag in ['COCO', 'CITYSCAPES']:
new_save_dir = save_dir
if hasattr(paddlex, 'pretrain_dir'):
......@@ -241,28 +241,28 @@ def get_pretrain_weights(flag, class_name, backbone, save_dir):
elif flag == 'CITYSCAPES':
url = cityscapes_pretrain[backbone]
fname = osp.split(url)[-1].split('.')[0]
# paddlex.utils.download_and_decompress(url, path=new_save_dir)
# return osp.join(new_save_dir, fname)
try:
logging.info(
"Connecting PaddleHub server to get pretrain weights...")
hub.download(backbone, save_path=new_save_dir)
except Exception as e:
logging.error(
"Couldn't download pretrain weight, you can download it manualy from {} (decompress the file if it is a compressed file), and set pretrain weights by your self".
format(url),
exit=False)
if isinstance(hub.ResourceNotFoundError):
raise Exception("Resource for backbone {} not found".format(
backbone))
elif isinstance(hub.ServerConnectionError):
raise Exception(
"Cannot get reource for backbone {}, please check your internet connection"
.format(backbone))
else:
raise Exception(
"Unexpected error, please make sure paddlehub >= 1.6.2")
return osp.join(new_save_dir, backbone)
paddlex.utils.download_and_decompress(url, path=new_save_dir)
return osp.join(new_save_dir, fname)
#try:
# logging.info(
# "Connecting PaddleHub server to get pretrain weights...")
# hub.download(backbone, save_path=new_save_dir)
#except Exception as e:
# logging.error(
# "Couldn't download pretrain weight, you can download it manualy from {} (decompress the file if it is a compressed file), and set pretrain weights by your self".
# format(url),
# exit=False)
# if isinstance(hub.ResourceNotFoundError):
# raise Exception("Resource for backbone {} not found".format(
# backbone))
# elif isinstance(hub.ServerConnectionError):
# raise Exception(
# "Cannot get reource for backbone {}, please check your internet connection"
# .format(backbone))
# else:
# raise Exception(
# "Unexpected error, please make sure paddlehub >= 1.6.2")
#return osp.join(new_save_dir, backbone)
else:
logging.error("Path of retrain weights '{}' is not exists!".format(
flag))
......@@ -30,7 +30,7 @@ setuptools.setup(
setup_requires=['cython', 'numpy'],
install_requires=[
"pycocotools;platform_system!='Windows'", 'pyyaml', 'colorama', 'tqdm',
'paddleslim==1.1.1', 'visualdl>=2.0.0', 'paddlehub>=1.8.2',
'paddleslim==1.0.1', 'visualdl>=2.0.0', 'paddlehub>=1.8.2',
'shapely>=1.7.0', "opencv-python"
],
classifiers=[
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册