Repository navigation
support data_parallel training and ucf101 dataset - #4819
Merged
Merged
Conversation
shippingwang
self-requested a review
August 28, 2020 07:33
huangjun12
reviewed
Aug 28, 2020
| '--model_path_pre', | ||
| type=str, | ||
| default='tsm', | ||
| help='default model path pre is tsm.') |
Collaborator
There was a problem hiding this comment.
what the meaning of model path pre?
| #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)) |
Collaborator
There was a problem hiding this comment.
print是调试代码?所有参数名打印出来太长了 建议注释或删除
| current_step_lr)) | ||
|
|
||
| # 6.2 save checkpoint | ||
| save_parameters = (not use_data_parallel) or ( |
Collaborator
There was a problem hiding this comment.
不用走or逻辑?单卡时也可以local_rank==0保存,参考
https://github.com/huangjun12/models/blob/9e2809a85c64115df92564d31055066300661141/dygraph/slowfast/train.py#L441
| 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() |
Collaborator
There was a problem hiding this comment.
t1-t5重新命名一下? 比如batch_start_time
| strategy) | ||
|
|
||
| # 4. load checkpoint | ||
| if args.checkpoint: |
Collaborator
There was a problem hiding this comment.
resume阶段, epoch计数是否对应调整下?
shippingwang
suggested changes
Aug 31, 2020
|
|
||
| loss = fluid.layers.cross_entropy( | ||
| input=outputs, label=labels, ignore_index=-1) | ||
| avg_loss = fluid.layers.mean(loss) |
Collaborator
There was a problem hiding this comment.
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
Collaborator
|
Add a result of multi-cards training? |
shippingwang
approved these changes
Sep 1, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
support data_parallel training and ucf101 dataset