From 5a9bfd4ed354bc874c0a8ceccf7347e2ec05fd05 Mon Sep 17 00:00:00 2001 From: lyuwenyu Date: Wed, 25 Aug 2021 13:20:40 +0800 Subject: [PATCH] add logger init --- hubconf.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hubconf.py b/hubconf.py index d615a905..b7f76745 100644 --- a/hubconf.py +++ b/hubconf.py @@ -41,10 +41,15 @@ class _SysPathG(object): self.path) -with _SysPathG( - os.path.join( - os.path.dirname(os.path.abspath(__file__)), 'ppcls', 'arch')): - import backbone +with _SysPathG(os.path.dirname(os.path.abspath(__file__)), ): + import ppcls + import ppcls.arch.backbone as backbone + + def ppclas_init(): + if ppcls.utils.logger._logger is None: + ppcls.utils.logger.init_logger() + + ppclas_init() def _load_pretrained_parameters(model, name): url = 'https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/{}_pretrained.pdparams'.format( -- GitLab