Commit c2ee7bbf authored by Davis King's avatar Davis King

Fixed a bug where the last column of data in a file wasn't loaded on

some OS X machines when load_libsvm_formatted_data() was called.
parent 03cfc68a
...@@ -85,12 +85,14 @@ namespace dlib ...@@ -85,12 +85,14 @@ namespace dlib
if (sin.get() != ':') if (sin.get() != ':')
throw sample_data_io_error("On line: " + cast_to_string(line_num) + ", error while reading file " + file_name); throw sample_data_io_error("On line: " + cast_to_string(line_num) + ", error while reading file " + file_name);
sin >> value >> ws; sin >> value;
if (sin && value != 0) if (sin && value != 0)
{ {
sample.insert(sample.end(), make_pair(key, value)); sample.insert(sample.end(), make_pair(key, value));
} }
sin >> ws;
} }
samples.push_back(sample); samples.push_back(sample);
......
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