Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
mkdir for non-existing output directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ifndef012 committed Jul 18, 2020
1 parent 3057899 commit f98d59f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import logging
import os
from abc import ABC
from pathlib import Path

import torch
from torch import distributed
Expand Down Expand Up @@ -44,6 +45,9 @@ def __init__(self, params=None, json_path=None):
self.params = get_from_dicts(params, default_parameters)
self.params = get_from_json(json_path, self.params)
self._sanity_check()
Path(self.params['output']
['save_model_dir']).expanduser().resolve().mkdir(parents=True,
exist_ok=True)
logging.info("Model parameters : %s", self.params)
self.input_type = self.params['input']['type']

Expand Down

0 comments on commit f98d59f

Please sign in to comment.