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
2ea99797c6
commit
aba4f717fb
@ -318,12 +318,19 @@ private:
|
|||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
CcuDNNAlgorithmElement elm;
|
CcuDNNAlgorithmElement elm;
|
||||||
msgpack::unpack(sbuf.data(), sbuf.size()).get().convert(elm);
|
msgpack::unpack(sbuf.data(), sbuf.size()).get().convert(elm);
|
||||||
sbuf.clear();
|
sbuf.clear();
|
||||||
|
|
||||||
const uint64_t key = InfoToKey(kernel_w, kernel_h, pad_w, pad_h, stride_w, stride_h, batch_size);
|
const uint64_t key = InfoToKey(kernel_w, kernel_h, pad_w, pad_h, stride_w, stride_h, batch_size);
|
||||||
mAlgoEmlMap[key] = std::move(elm);
|
mAlgoEmlMap[key] = std::move(elm);
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
boost::filesystem::remove(SavePath);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -372,6 +379,8 @@ public:
|
|||||||
{
|
{
|
||||||
auto &eml = p.second;
|
auto &eml = p.second;
|
||||||
if (eml.IsModefy())
|
if (eml.IsModefy())
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
msgpack::sbuffer sbuf;
|
msgpack::sbuffer sbuf;
|
||||||
msgpack::pack(sbuf, eml);
|
msgpack::pack(sbuf, eml);
|
||||||
@ -390,6 +399,9 @@ public:
|
|||||||
eml.Saved();
|
eml.Saved();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch(...)
|
||||||
|
{}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user