본문으로 바로가기
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

 

 

 

 

checkpoint = torch.load(ckpt_dir, map_location=lambda storage, loc: storage)
self.model.load_state_dict(checkpoint['state_dict'])

또는

device = torch.device('cpu')
checkpoint = torch.load(ckpt_dir, map_location=device)
self.model.load_state_dict(checkpoint['state_dict'])

로 불러올 수 있다.