mirror of
https://github.com/lltcggie/waifu2x-caffe.git
synced 2025-06-26 21:52:49 +00:00
cuDNNのアルゴリズムデータ保存パスが意図しない物になることがあるのを修正
This commit is contained in:
parent
da104e7f3b
commit
d8e7f26e6f
@ -561,13 +561,32 @@ Waifu2x::eWaifu2xError Waifu2x::Init(const eWaifu2xModelType mode, const int noi
|
||||
|
||||
const auto cuDNNCheckEndTime = std::chrono::system_clock::now();
|
||||
|
||||
boost::filesystem::path exe_dir_path(ExeDir);
|
||||
if (exe_dir_path.is_absolute())
|
||||
exe_dir_path = exe_dir_path.branch_path();
|
||||
|
||||
if (Process == "cudnn" && boost::filesystem::exists(exe_dir_path))
|
||||
if (Process == "cudnn")
|
||||
{
|
||||
const boost::filesystem::path cudnn_data_dir_path(exe_dir_path / "cudnn_data");
|
||||
// exeのディレクトリにcuDNNのアルゴリズムデータ保存
|
||||
boost::filesystem::path cudnn_data_base_dir_path(ExeDir);
|
||||
if (cudnn_data_base_dir_path.is_relative())
|
||||
cudnn_data_base_dir_path = boost::filesystem::system_complete(cudnn_data_base_dir_path);
|
||||
|
||||
if (!boost::filesystem::is_directory(cudnn_data_base_dir_path))
|
||||
cudnn_data_base_dir_path = cudnn_data_base_dir_path.branch_path();
|
||||
|
||||
if (!boost::filesystem::exists(cudnn_data_base_dir_path))
|
||||
{
|
||||
// exeのディレクトリが取得できなければカレントディレクトリに保存
|
||||
|
||||
cudnn_data_base_dir_path = boost::filesystem::current_path();
|
||||
|
||||
if (cudnn_data_base_dir_path.is_relative())
|
||||
cudnn_data_base_dir_path = boost::filesystem::system_complete(cudnn_data_base_dir_path);
|
||||
|
||||
if (!boost::filesystem::exists(cudnn_data_base_dir_path))
|
||||
cudnn_data_base_dir_path = "./";
|
||||
}
|
||||
|
||||
if (boost::filesystem::exists(cudnn_data_base_dir_path))
|
||||
{
|
||||
const boost::filesystem::path cudnn_data_dir_path(cudnn_data_base_dir_path / "cudnn_data");
|
||||
|
||||
bool isOK = false;
|
||||
if (boost::filesystem::exists(cudnn_data_dir_path))
|
||||
@ -600,6 +619,7 @@ Waifu2x::eWaifu2xError Waifu2x::Init(const eWaifu2xModelType mode, const int noi
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const boost::filesystem::path mode_dir_path(GetModeDirPath(model_dir));
|
||||
if (!boost::filesystem::exists(mode_dir_path))
|
||||
|
Loading…
x
Reference in New Issue
Block a user