Skip to content

support data_parallel training and ucf101 dataset - #4819

Merged
shippingwang merged 9 commits into
PaddlePaddle:developfrom
chajchaj:tsm_ucf101
Sep 1, 2020
Merged

shippingwang merged 9 commits into
PaddlePaddle:developfrom
chajchaj:tsm_ucf101

Conversation

@chajchaj

Copy link
Copy Markdown
Collaborator

support data_parallel training and ucf101 dataset

@shippingwang
shippingwang self-requested a review August 28, 2020 07:33
Comment thread dygraph/tsm/train.py
'--model_path_pre',
type=str,
default='tsm',
help='default model path pre is tsm.')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what the meaning of model path pre?

Comment thread dygraph/tsm/train.py Outdated
#load resnet50 pretrain
pre_state_dict = fluid.load_program_state(args.resnet50_dir)
for key in pre_state_dict.keys():
print('pre_state_dict.key: {}'.format(key))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

print是调试代码?所有参数名打印出来太长了 建议注释或删除

Comment thread dygraph/tsm/train.py Outdated
current_step_lr))

# 6.2 save checkpoint
save_parameters = (not use_data_parallel) or (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Comment thread dygraph/tsm/train.py
t_last = time.time()
# 6.1 for each batch, call model() , backward(), and minimize()
for batch_id, data in enumerate(train_reader()):
t1 = time.time()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

t1-t5重新命名一下? 比如batch_start_time

Comment thread dygraph/tsm/train.py
strategy)

# 4. load checkpoint
if args.checkpoint:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

resume阶段, epoch计数是否对应调整下?

Comment thread dygraph/tsm/train.py

loss = fluid.layers.cross_entropy(
input=outputs, label=labels, ignore_index=-1)
avg_loss = fluid.layers.mean(loss)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

copy avg_loss to a new variable , and output(print) it instead of avg_loss, in avoid to print avg_loss after scale_loss function, which is already divided by the number of cards

@shippingwang

Copy link
Copy Markdown
Collaborator

Add a result of multi-cards training?

@shippingwang
shippingwang merged commit e320130 into PaddlePaddle:develop Sep 1, 2020
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