def make_model_path(name): log_path = os.path.join('log', name) if os.path.isdir(log_path): subprocess.call(('rm -rf %s' % log_path).split()) os.makedirs(log_path) return log_path