1f720ee453871b2ab764f608926281716ef7bf81,tools/train_pl.py,,,#,340
Before Change
lit = LitModel(opt)
// warning grad_clip_mode is ignored.
trainer = pl.Trainer(
callbacks=[OnEpochStartCallback()],
default_root_dir=opt.checkpoint_path,
resume_from_checkpoint=resume_from,
distributed_backend="ddp",
After Change
// fast_dev_run=True,
)
if os.getenv("EVALUATE", "0") == "1":
lit.load_state_dict(torch.load(resume_from)["state_dict"])
// Because ddp cant work with test
trainer = pl.Trainer(
default_root_dir=opt.checkpoint_path,
resume_from_checkpoint=resume_from,
distributed_backend="dp",
gpus=torch.cuda.device_count(),
checkpoint_callback=checkpoint_callback,
profiler=True,
// limit_train_batches=500,
// progress_bar_refresh_rate=0,
// fast_dev_run=True,
)
trainer.test(lit)
else:
trainer.fit(lit)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances
Project Name: ruotianluo/ImageCaptioning.pytorch
Commit Name: 1f720ee453871b2ab764f608926281716ef7bf81
Time: 2020-07-05
Author: rluo@ttic.edu
File Name: tools/train_pl.py
Class Name:
Method Name:
Project Name: open-mmlab/mmcv
Commit Name: 48d990258549ca626fcf8c34488c00ed6fce108a
Time: 2021-02-26
Author: z55250825@163.com
File Name: setup.py
Class Name:
Method Name: get_extensions
Project Name: dmlc/gluon-nlp
Commit Name: d0a802b5a03b9497236c84e18501c2f496097d6b
Time: 2021-03-19
Author: lausen@amazon.com
File Name: setup.py
Class Name:
Method Name: