From ca5a5ec480db806674043311b2c59fd318ad4f41 Mon Sep 17 00:00:00 2001 From: luotao1 Date: Fri, 28 Oct 2016 12:51:35 +0800 Subject: [PATCH] Make Paddle --save_dir support a directory name (#277) * Also fix #243 --- paddle/trainer/ParamUtil.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/paddle/trainer/ParamUtil.cpp b/paddle/trainer/ParamUtil.cpp index dae8b44b6db..bb309a54975 100644 --- a/paddle/trainer/ParamUtil.cpp +++ b/paddle/trainer/ParamUtil.cpp @@ -89,6 +89,9 @@ void ParameterUtil::saveParameters(int passId, int passInnerId) { } std::string basePath = config_->getSaveDir(); + if (basePath.find('/') == std::string::npos) { + basePath = "./" + basePath; + } mkDirRecursively(basePath.c_str()); std::string saveDir = path::join(basePath, buf); -- GitLab