Commit 247beb3d authored by Davis King's avatar Davis King

Removed support for old serialization formats in many of the DNN objects. This

is to clean up the code since it was getting somewhat complex and this is the
last opportunity to do this kind of cleanup prior to the release of dlib v19.0.

If you have saved network objects and want to convert them to the current
format, then make sure you checkout the previous commit (labeled with tag
before_dnn_serialization_cleanup) and then deserialize and serialize your
network back to disk.
parent fc7f9b6c
This diff is collapsed.
......@@ -731,7 +731,7 @@ namespace dlib
item.wait_for_thread_to_pause();
int version = 0;
deserialize(version, in);
if (version != 6 && version != 7)
if (version != 7)
throw serialization_error("Unexpected version found while deserializing dlib::dnn_trainer.");
size_t num_layers = 0;
......@@ -761,16 +761,8 @@ namespace dlib
deserialize(item.epoch_iteration, in);
deserialize(item.epoch_pos, in);
deserialize(item.train_one_step_calls, in);
if (version == 7)
{
deserialize(item.lr_schedule, in);
deserialize(item.lr_schedule_pos, in);
}
else
{
item.lr_schedule.set_size(0);
item.lr_schedule_pos = 0;
}
deserialize(item.lr_schedule, in);
deserialize(item.lr_schedule_pos, in);
if (item.devices.size() > 1)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment