Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program fails with empty newline at the end of input txt file #7

Open
DavidMChan opened this issue Sep 21, 2017 · 0 comments
Open

Program fails with empty newline at the end of input txt file #7

DavidMChan opened this issue Sep 21, 2017 · 0 comments

Comments

@DavidMChan
Copy link

DavidMChan commented Sep 21, 2017

There's an issue with the robustness of the extractor where it fails when an extra empty new-line is added at the end of the input image list. There should be a check at dataset.lua, line 63.

Something along the lines of

for line in io.lines(imagePathFile) do
      if line != nil or line !='' then
            local id_path_label = line:split("\t")
            ffi.copy(id_data, id_path_label[1])
            ffi.copy(path_data, id_path_label[2])

            id_data = id_data + idMaxLength
            path_data = path_data + pathMaxLength

            if self.verbose and count % 10000 == 0 then
               xlua.progress(count, length)
            end;
            count = count + 1
      end;
     
end

If this check isn't there then the program will crash on the copy statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant