-
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 2 commits
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 |
---|---|---|
|
@@ -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) | ||
exe = fluid.Executor(place) | ||
exe.run(fluid.default_startup_program()) | ||
|
||
|
@@ -209,15 +209,12 @@ def run_benchmark(model, args): | |
label = np.array(map(lambda x: x[1], data)).astype('int64') | ||
label = label.reshape([-1, 1]) | ||
|
||
iter = 0 | ||
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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
every_pass_loss = [] | ||
every_pass_acc = [] | ||
accuracy.reset(exe) | ||
if iter == args.iterations: | ||
iter = 0 | ||
iter = 0 | ||
for batch_id, data in enumerate(train_reader()): | ||
if iter < args.skip_batch_num: | ||
iter += 1 | ||
|
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