"Connecting PaddleHub server to get pretrain weights...")
hub.download(backbone,save_path=new_save_dir)
exceptExceptionase:
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)
ifisinstance(e,hub.ResourceNotFoundError):
raiseException("Resource for backbone {} not found".format(
backbone))
elifisinstance(e,hub.ServerConnectionError):
raiseException(
"Cannot get reource for backbone {}, please check your internet connection"
.format(backbone))
else:
raiseException(
"Unexpected error, please make sure paddlehub >= 1.6.2")
# "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")
"Connecting PaddleHub server to get pretrain weights...")
hub.download(backbone,save_path=new_save_dir)
exceptExceptionase:
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)
ifisinstance(hub.ResourceNotFoundError):
raiseException("Resource for backbone {} not found".format(
backbone))
elifisinstance(hub.ServerConnectionError):
raiseException(
"Cannot get reource for backbone {}, please check your internet connection"
.format(backbone))
else:
raiseException(
"Unexpected error, please make sure paddlehub >= 1.6.2")
# "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(