-
Notifications
You must be signed in to change notification settings - Fork 14
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
change duration compute methods #49
Changes from 1 commit
26f5b2d
78cce58
3713d12
8d5b1aa
6e9b36b
0157ed8
c838e11
ba60b28
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,12 +170,16 @@ def run_benchmark(model, args): | |
|
||
iter = 0 | ||
im_num = 0 | ||
start_time = time.time() | ||
for pass_id in range(args.pass_num): | ||
accuracy.reset(exe) | ||
if iter == args.iterations: | ||
break | ||
iter = 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this modification right? What's the use of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it shoud be: |
||
for batch_id, data in enumerate(train_reader()): | ||
if iter == args.skip_batch_num: | ||
if iter < args.skip_batch_num: | ||
iter += 1 | ||
continue | ||
if pass_id == 0: | ||
start_time = time.time() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For all batches in pass 0, this line will be executed. Is this what you want? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. modified |
||
if iter == args.iterations: | ||
break | ||
|
@@ -195,9 +199,9 @@ def run_benchmark(model, args): | |
im_num += label.shape[0] | ||
|
||
duration = time.time() - start_time | ||
im_num = im_num - args.skip_batch_num * args.batch_size | ||
#im_num = im_num - args.skip_batch_num * args.batch_size | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please delete the codes commented There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
examples_per_sec = im_num / duration | ||
sec_per_batch = duration / (iter - args.skip_batch_num) | ||
sec_per_batch = duration / (iter - args.skip_batch_num) / args.pass_num | ||
|
||
print('\nTotal examples: %d, total time: %.5f' % (im_num, duration)) | ||
print('%.5f examples/sec, %.5f sec/batch \n' % | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/ccmteorljh/benchmark/blob/6e9b36b2cd318f308b80c984617f79f6eccdce5e/fluid/resnet50.py#L170 Maybe moving L170 before L213 is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done