mirror of https://github.com/davisking/dlib.git
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.
This commit is contained in:
parent
03cfc68af8
commit
c2ee7bbfd5
|
@ -85,12 +85,14 @@ namespace dlib
|
|||
if (sin.get() != ':')
|
||||
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)
|
||||
{
|
||||
sample.insert(sample.end(), make_pair(key, value));
|
||||
}
|
||||
|
||||
sin >> ws;
|
||||
}
|
||||
|
||||
samples.push_back(sample);
|
||||
|
|
Loading…
Reference in New Issue