Skip to content

Conversation

@qingqing01
Copy link
Collaborator

No description provided.

momentum=0.9,
regularization=fluid.regularizer.L2Decay(1e-4))

opts = optimizer.minimize(avg_cost)
Copy link
Contributor

Choose a reason for hiding this comment

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

opts = optimizer.minimize(avg_cost) should be placed in line 84. Because minimize will add the backward ops.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

train_loss = np.array(train_info[0]).mean()
train_acc1 = np.array(train_info[1]).mean()
train_acc5 = np.array(train_info[2]).mean()
for data in test_reader():
Copy link
Contributor

Choose a reason for hiding this comment

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

Testing phase can be written as a function. Just advise, this is my own habit.

regularization=fluid.regularizer.L2Decay(1e-4))

opts = optimizer.minimize(avg_cost)
fluid.memory_optimize(fluid.default_main_program())
Copy link
Contributor

Choose a reason for hiding this comment

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

test_program's memory also need to be optimized.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. But the memory_optimize has never been tested in ParallelExecutor.

opts = optimizer.minimize(avg_cost)
fluid.memory_optimize(fluid.default_main_program())

inference_program = fluid.default_main_program().clone()
Copy link
Contributor

Choose a reason for hiding this comment

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

inference_program should only contain the forward ops. So line 80 should be placed in line62.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. But the original code is also right.

loss, acc1, acc5 = exe.run(
fluid.default_main_program(),
feed=feeder.feed(data),
fetch_list=[avg_cost, acc_top1, acc_top5])
Copy link
Contributor

Choose a reason for hiding this comment

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

fetching operation is time-consuming, if possible, we can fetch data every 10 iterations.

@qingqing01 qingqing01 merged commit 9aa2637 into PaddlePaddle:develop Apr 9, 2018
@qingqing01 qingqing01 deleted the se_resnext branch January 28, 2019 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants