load the model with libtorch in c++, "The file not found: retinaface_mobilenet/model.json"
Hi,Thanks for your great work. I transform the model from pytorch(.pth) to libtorch(.pt). When I load the model with libtorch in c++, and then get the error:
terminate called after throwing an instance of 'c10::Error'
what(): [enforce fail at inline_container.cc:185] . file not found: retinaface_mobilenet/model.json
frame #0: c10::ThrowEnforceNotMet(char const*, int, char const*, std::__cxx11::basic_string<char, std::char_traits
I transform the model with python code : example = torch.rand(1, 3, width, height).cuda() trace_script_module = torch.jit.trace(net, example,check_trace=True) trace_script_module.save("/home/.../retinaface_mobilenet.pt")
And I load the model with c++: std::string modelpath = "/home/.../retinaface_mobilenet.pt"; torch::jit::script::Module module = torch::jit::load(modelpath)
How can I deal with the problem "The file not found: retinaface_mobilenet/model.json" ?
have you solved the problem?
I also meet the same error , in my case, my pytorch version is 1.4.0 whitch is used to trace torchscript model , while my libtorch c++ backend version is 1.2.0, then I use pytorch 1.2.0 to trace again and error free.
check_trace=T hi,have you solved this error?