반응형
모델을 저장하는 방법은 2가지가 있다.
1. 모델의 state dictionary를 저장하는 방법
2. 모델을 통째로 저장하는 방법
모델의 state dictionary를 저장하는 방법
torch.save(model.state_dict(), './mode.pth')
모델을 통째로 저장하는 방법
torch.save(model, './model.pth')
반응형
'머신러닝' 카테고리의 다른 글
파이토치(Pytorch) Distributed Data Parallel (DDP)사용하기 (0) | 2022.10.30 |
---|---|
Decision Tree; 결정트리; 의사결정트리 (0) | 2022.10.28 |
파이토치 모델 로딩, pytorch model loading (0) | 2022.10.27 |
Pytorch Simple - 1. Autograd (0) | 2019.09.09 |
사진에 나온 얼굴에서 감정을 읽는 Emotion API (0) | 2018.07.22 |