mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Fix deserialize logic in loss_multibinary_log (#2547)
This commit is contained in:
parent
1b7053fe9d
commit
3b518f40ce
@ -877,11 +877,20 @@ namespace dlib
|
||||
{
|
||||
std::string version;
|
||||
deserialize(version, in);
|
||||
if (version != "loss_multibinary_log_" || version != "loss_multibinary_log_2")
|
||||
throw serialization_error("Unexpected version found while deserializing dlib::loss_multibinary_log_.");
|
||||
if (version == "loss_multibinary_log_2")
|
||||
if (version == "loss_multibinary_log_")
|
||||
{
|
||||
item.gamma = 0;
|
||||
return;
|
||||
}
|
||||
else if (version == "loss_multibinary_log_2")
|
||||
{
|
||||
deserialize(item.gamma, in);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw serialization_error("Unexpected version found while deserializing dlib::loss_multibinary_log_.");
|
||||
}
|
||||
}
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& out, const loss_multibinary_log_& item)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user