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

dump output when evaulating #2168

Merged
merged 1 commit into from
Jun 13, 2019
Merged

Conversation

eggonlea
Copy link
Collaborator

Save the output for future use (e.g. calculate WER directly without running STT again).
And print the current progress.

Signed-off-by: Li Li eggonlea@msn.com

@ghost
Copy link

ghost commented Jun 12, 2019

No Taskcluster jobs started for this pull request
The `allowPullRequests` configuration for this repository (in `.taskcluster.yml` on the
default branch) does not allow starting tasks for this pull request.

@eggonlea
Copy link
Collaborator Author

Fixed the shared Queue issue

Copy link
Contributor

@reuben reuben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I have a few questions/comments.

evaluate_tflite.py Outdated Show resolved Hide resolved
work_todo.join()
print('\nTotally %d work done' % work_done.qsize())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the count variable and these prints also debugging leftover?

Copy link
Collaborator Author

@eggonlea eggonlea Jun 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the redundant 'Total' can be removed if you think it's too much.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would keep just the latter I guess.


wer, cer, samples = calculate_report(ground_truths, predictions, losses)
mean_loss = np.mean(losses)

print('Test - WER: %f, CER: %f, loss: %f' %
(wer, cer, mean_loss))

with open(args.csv + '.txt', 'w') as ftxt:
with open(args.csv + '.out', 'w') as fout:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you can comma separate context managers:

with open(args.csv + '.txt', 'w') as ftxt, open(args.csv + '.out', 'w') as fout:
    # ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx. Will do


wer, cer, samples = calculate_report(ground_truths, predictions, losses)
mean_loss = np.mean(losses)

print('Test - WER: %f, CER: %f, loss: %f' %
(wer, cer, mean_loss))

with open(args.csv + '.txt', 'w') as ftxt:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be better to condition this on some flag, as this behavior can be surprising, and also fail in surprising ways (e.g. dirname(args.csv) may be read only).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

work_todo = JoinableQueue() # this is where we are going to store input data
work_done = Queue() # this where we are gonna push them out
work_done = manager.Queue() # this where we are gonna push them out
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thanks for the fix.

@lissyx lissyx requested a review from reuben June 13, 2019 14:08
@reuben
Copy link
Contributor

reuben commented Jun 13, 2019

@eggonlea can you fix the linter errors? Then we can merge this.

Also dump output to a file
Fixed some trivial pylint issues at the same time

Signed-off-by: Li Li <eggonlea@msn.com>
@eggonlea
Copy link
Collaborator Author

Fixed some legacy pylint issues as well.

@reuben
Copy link
Contributor

reuben commented Jun 13, 2019

Thanks!

@reuben reuben merged commit 193e054 into mozilla:master Jun 13, 2019
@eggonlea eggonlea deleted the evaluate_tflite branch June 13, 2019 18:14
@lock
Copy link

lock bot commented Jul 13, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Jul 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants