Unhandle exception when using "forward"

My environment:
cuda 11.3, pytorch1.11, libtorch-win-shared-with-deps-Debug-1.11.0+cu113, win10, vs 2017, qt 5.12.

My network: An 3D image processing network.

The PT file is export by Python code:
model.load_state_dict(torch.load(’./save_models/mynet.pth’,map_location=‘cpu’))
model.eval()
example = torch.rand(1, 1,16,32,32)
traced_script_module = torch.jit.trace(model, example)
traced_script_module.save("./model_CPP.pt")

My C++ code:
device_type = at::kCPU;
try {
module=
torch::jit::load(“model_CPP.pt”, device_type);
module.eval();
}
catch (const c10::Error& e) {
QMessageBox::warning(this, “warning”, “error loading the model.”);
std::cerr << “error loading the model\n”;
return false;
}
module.to(device_type);
torch::Tensor img_tensor1 = torch::rand({ 1,16,32,32 });
img_tensor1 = img_tensor1.to(torch::kFloat32).to(device_type);

std::vector<torch::jit::IValue> inputs;
inputs.push_back(img_tensor1);

torch::NoGradGuard no_grad;
at::Tensor output;
try {
	auto res = module.forward(inputs);
	output = res.toTensor();
}
catch (const c10::Error& e) {
	std::cout << e.what() << std::endl;
}

The error information when executing module.forward():
Unhandled exception at 0x00007FFBAA574F69 in Test.exe: Microsoft C++ exception: std::runtime_error at memory location 0x000000B6DFCF29D8.

Could you help me solve this problem?