C++ embedding python and load pytorch model

I am using c++ application to embedding python. The whole process is : C++ read an image, and transfer the image as a parameter to python. The python code load a CNN model(trained with Pytorch) and feed the image into the network, finally the output of network is called back to c++ program. I am doing this on Windows 10. When the python code execute the following line:

state_dict = torch.load('model_lastest.pt')

it fails and return the error "System Error: "

I have tried to directly load the same model in pure python , no error occurred. But once I use c++ to embed this python code, the above error happens. Can any one help me?

I would like to do the exact same thing. Any alternatives to the method described above?