Skip to content

Commit

Permalink
repair train bug in multi gpu
Browse files Browse the repository at this point in the history
  • Loading branch information
liuhongen1234567 committed Jan 21, 2025
1 parent 1049c66 commit 7aeb60c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions configs/rec/rec_latex_ocr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Global:
rec_char_dict_path: ppocr/utils/dict/latex_ocr_tokenizer.json
save_res_path: ./output/rec/predicts_latexocr.txt
d2s_train_image_shape: [1,256,256]
find_unused_parameters: True

Optimizer:
name: AdamW
Expand Down
5 changes: 4 additions & 1 deletion tools/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ def main(config, device, logger, vdl_writer, seed):
)

if config["Global"]["distributed"]:
model = paddle.DataParallel(model)
find_unused_parameters = config["Global"].get("find_unused_parameters", False)
model = paddle.DataParallel(
model, find_unused_parameters=find_unused_parameters
)
# start train
program.train(
config,
Expand Down

0 comments on commit 7aeb60c

Please sign in to comment.