Skip to content

Conversation

@ccmeteorljh
Copy link

1,、修改了duration的计算方法,原来的是统计了最后一个pass的时间,但是计算examples_per_sec时im_num缺失所有pass的图片总和,现在修改duration为所有pass的时间总和;
2、skip_batch_num这个参数没有起到作用,现在修改了


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
Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

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

done

iter += 1
continue
if pass_id == 0:
start_time = time.time()
Copy link
Contributor

@ranqiu92 ranqiu92 Jan 15, 2018

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?

Copy link
Author

Choose a reason for hiding this comment

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

modified

Copy link
Contributor

@ranqiu92 ranqiu92 left a comment

Choose a reason for hiding this comment

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

accuracy.reset(exe)
if iter == args.iterations:
break
iter = 0
Copy link
Contributor

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 ?

Copy link
Author

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()):

'--model',
type=str,
choices=['resnet_imagenet', 'resnet_cifar10'],
default='resnet_imagenet',
Copy link
Contributor

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.

Copy link
Author

Choose a reason for hiding this comment

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

Done

parser.add_argument(
'--pass_num', type=int, default=100, help='The number of passes.')
parser.add_argument(
'--data_format',
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Done

Copy link
Owner

@dzhwinter dzhwinter 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

@dzhwinter dzhwinter merged commit 2cc7a1e into dzhwinter:master Jan 19, 2018
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

Successfully merging this pull request may close these issues.

3 participants