-
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
Conversation
fluid/resnet50.py
Outdated
@@ -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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
done
fluid/resnet50.py
Outdated
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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
modified
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.
fluid/resnet50.py
Outdated
accuracy.reset(exe) | ||
if iter == args.iterations: | ||
break | ||
iter = 0 |
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.
Is this modification right? What's the use of args.iterations
?
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.
I think it shoud be:
accuracy.reset(exe)
iter = 0
the args.iterations is used to limit the iterations in each pass, so it used in:
for batch_id, data in enumerate(train_reader()):
fluid/resnet50.py
Outdated
@@ -198,7 +198,7 @@ def run_benchmark(model, args): | |||
buf_size=5120), | |||
batch_size=args.batch_size) | |||
|
|||
place = core.CPUPlace() if args.device == 'CPU' else core.CUDAPlace(0) | |||
place = core.CPUPlace() if args.device == 'CPU' else core.GPUPlace(0) |
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.
I remember CUDAPlace is used in the latest PaddlePaddle. Could you refer to the source codes to confirm this.
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
fluid/resnet50.py
Outdated
im_num = 0 | ||
start_time = time.time() | ||
for pass_id in range(args.pass_num): |
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
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.
Looks Good
1,、修改了duration的计算方法,原来的是统计了最后一个pass的时间,但是计算examples_per_sec时im_num缺失所有pass的图片总和,现在修改duration为所有pass的时间总和;
2、skip_batch_num这个参数没有起到作用,现在修改了