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

Predicted labels print in incorrect order #17

Open
jacobmanning opened this issue May 9, 2018 · 0 comments
Open

Predicted labels print in incorrect order #17

jacobmanning opened this issue May 9, 2018 · 0 comments

Comments

@jacobmanning
Copy link

There is a bug here causing predicted labels to be printed in incorrect order. Traversing a java.util.PriorityQueue with a range-based for loop does not guarantee traversal in sorted order. Fixed by converting PQ to array, sorting array with PQ.comparator(), and returning the results in sorted order.

More information on the undefined behavior of traversing PQ here.

I just put in a pull request to fix this issue in the similar Codelabs TF image classifier repo. The same fix to TensorFlowHelper.java will work here.

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