Mask RCNN Error 문의 (No such serialized tensor 'fpn.C1.0.weight')

안녕하세요~! 파이토치로 Mask RCNN을 배우고 있는 사람입니다.

model file을 model = models.detection.maskrcnn_resnet50_fpn(pretrained=True)으로 다운로드하였고
jit::script로 변환 및 저장하습니다.(maskrcnn_resnet50_fpn.pt)
이 파일을 아래 Source에서와 같이 LoadStateDict 과정 중에 No such serialized tensor ‘fpn.C1.0.weight’ 에러가 발생하였습니다.

혹시 이와 같은 에러를 해결해보신 분 계실까요??

< --------- Source file : LoadStateDict --------- >
void LoadStateDict(torch::nn::Module& module,
const std::string& file_name,
const std::string& ignore_name_regex)
{
torch::serialize::InputArchive archive;
archive.load_from(file_name);
torch::NoGradGuard no_grad;
std::regex re(ignore_name_regex);
std::smatch m;
auto params = module.named_parameters(true /recurse/);
auto buffers = module.named_buffers(true /recurse/);

for (auto& val : params) {
if (!std::regex_match(val.key(), m, re))
{
std::cout << "val.key() : " << val.key()<< “\n”;
archive.read(val.key(), val.value());
}
}
for (auto& val : buffers) {
if (!std::regex_match(val.key(), m, re)) {
std::cout << "val.key() : " << val.key() << “\n”;
archive.read(val.key(), val.value(), /is_buffer/ true);
}
}
}

< --------- Error Message --------- >
No such serialized tensor ‘fpn.C1.0.weight’
Exception raised from read at C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\api\src\serialize\input-archive.cpp:69 (most recent call first):
00007FFA5F35AD0200007FFA5F35ACA0 c10.dll!c10::Error::Error [ @ ]
00007FFA5F35A78E00007FFA5F35A740 c10.dll!c10::detail::torchCheckFail [ @ ]
00007FF9F8A481C300007FF9F8A48150 torch_cpu.dll!torch::serialize::InputArchive::read [ @ ]
00007FF64F137AE200007FF64F11CFC0 mask-rcnn_demo.exe!c10::ivalue::Future::waitAndThrow [ @ ]
00007FF64F11D80200007FF64F11CFC0 mask-rcnn_demo.exe!c10::ivalue::Future::waitAndThrow [ @ ]
00007FF64F165DAC00007FF64F11CFC0 mask-rcnn_demo.exe!c10::ivalue::Future::waitAndThrow [ @ ]
00007FFAA86674B400007FFAA86674A0 KERNEL32.DLL!BaseThreadInitThunk [ @ ]
00007FFAAA5226A100007FFAAA522680 ntdll.dll!RtlUserThreadStart [ @ ]

1개의 좋아요

해결되었습니다.