๋ฐ˜์‘ํ˜•

๐Ÿ Python & library/PyTorch Lightning 2

[PyTorch Lightning] checkpoint ์ €์žฅํ•˜๊ธฐ

๊ธฐ๋ณธํŽธ - ์ž๋™ ์ €์žฅ Saving and loading checkpoints (basic) โ€” PyTorch Lightning 1.9.0 documentation Shortcuts pytorch-lightning.readthedocs.io PyTorch Lightning์˜ Trainer์„ ์ด์šฉํ•ด ํ•™์Šต์„ ์ง„ํ–‰ํ•˜๋ฉด, ์ž๋™์œผ๋กœ ๊ฐ€์žฅ ๋งˆ์ง€๋ง‰ training epoch์˜ checkpoint๋ฅผ ์ €์žฅํ•ด์ค€๋‹ค. trainer = Trainer() ๋งŒ์•ฝ checkpoint๊ฐ€ ์ €์žฅ๋˜๋Š” ์œ„์น˜๋ฅผ ๋ฐ”๊พธ๊ณ  ์‹ถ๋‹ค๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ง€์ •ํ•ด์ค„ ์ˆ˜ ์žˆ๋‹ค. trainer = Trainer(default_root_dir='path/to/') ํ˜น์€ ๋ณ„๋„๋กœ checkpoint ์ €์žฅ์„ ํ•˜์ง€ ์•Š์œผ๋ ค๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ง€์ •ํ•˜๋ฉด ๋œ๋‹ค. trainer = Tr..

[PyTorch Lightning] ๋กœ๊ทธ ๊ธฐ๋ก, Tensorboard๋กœ Loggingํ•˜๊ธฐ

Logging โ€” PyTorch Lightning 1.8.6 documentation Shortcuts pytorch-lightning.readthedocs.io ๋กœ๊ทธ๋ฅผ ๊ธฐ๋กํ•˜๋Š” ๋ฐฉ๋ฒ•์€ Lightening Module์—์„œ self.log()๋‚˜ self.log_dict()๋ฅผ ์ด์šฉํ•˜๋ฉด ๋œ๋‹ค. def training_step(self, batch, batch_idx): self.log_dict({'acc': acc, 'recall': recall}) self.log('acc', acc) logging (log(), log_dict() ๋ชจ๋‘ ๋™์ผํ•˜๊ฒŒ ์ ์šฉ) ์˜ ์ค‘์š”ํ•œ ์ธ์ž๋Š” on_step๊ณผ on_epoch์ด๋‹ค. on_step: ํ˜„์žฌ step์— logging on_epoch: ๋กœ๊ทธ๋ฅผ ์ถ•์ ํ•˜์—ฌ epoch ๋งˆ์ง€๋ง‰์— ..

1
๋ฐ˜์‘ํ˜•