diff --git a/paddlehub/config.py b/paddlehub/config.py index 4e074b3e0464e42fcaf47bfd78ebdfac92dc094b..5d0bfa70114f062be17959f80128a6f61641d615 100644 --- a/paddlehub/config.py +++ b/paddlehub/config.py @@ -32,6 +32,11 @@ class HubConfig: def __init__(self): self._initialize() self.file = os.path.join(hubenv.CONF_HOME, 'config.yaml') + + if not os.path.exists(self.file): + self.flush() + return + with open(self.file, 'r') as file: try: cfg = yaml.load(file, Loader=yaml.FullLoader)