본문 바로가기
Development/Pytorch

[torch.load() 에러] RuntimeError: version <= kMaxSupportedFileFormatVersion INTERNAL ASSERT FAILED at ..\caffe2\serialize\inline_container.cc:132

by 위풍당당 가리비 2023. 6. 11.
반응형

반응형

상황

  • .pt 파일을 load할 때 pytorch 버전이 너무 낮다고 하는 문제가 발생함.

에러 내용

  • RuntimeError: version <= kMaxSupportedFileFormatVersion INTERNAL ASSERT FAILED at ..\caffe2\serialize\inline_container.cc:132, please report a bug to PyTorch. Attempted to read a PyTorch file with version 3, but the maximum supported version for reading is 2. Your PyTorch installation may be too old. (init at ..\caffe2\serialize\inline_container.cc:132)

Solution

  • pytorch 1.6 버전부터 torch save의 default 저장방식이 zip file-based file format으로 저장하도록 바뀌었음. 그래서 이전 버전에서는 이런 포맷을 load할 수 없다고 한다. 당시 torch 버전은 1.4였었음.
  • 그래서  1.4 → 1.8로 pytorch 버전을 변경했더니 제대로 동작함.

 


Reference

반응형

'Development > Pytorch' 카테고리의 다른 글

Pytorch tensor 이미지 저장, 불러오기  (1) 2023.06.11