After training a model, I created a trace file in Python side using Pytorch 1.5. I tried to load that file in C++ side using libtorch 1.5 writing that code:
int main(int argc, const char* argv[]) {
//Deserialize the ScriptModule from a file using torch::jit::load().
torch::jit::script::Module module = torch::jit::load("D:/Downloads/deneme18.pt");
module.to(torch::kCUDA);
}
It gave me this error message:
"Unhandled exception at 0x00007FF8C2A0A799 in DL_Predicton.exe: Microsoft C++ exception: c10::Error at memory location 0x0000009B6118EFE0."