The results of training models using the PyTorch C++ API and PyTorch (Python) are significantly different

Hi, I traced a custom model using the method torch.jit.script. However, when fine-tuning the torchscript on a dataset, I obtained different accuracy results (85% using PyTorch Python and 75% using PyTorch C++ API).

# c++ 
torch::jit::script::Module model = torch::jit::load(options.model_path, torch::kCUDA); 
# Python
model = torch.jit.load(model_path)

Also, I think that the data processing and optimization settings in PyTorch C++ API and PyTorch Python are the same. Because I was able to achieve the same results (acc 82%) using the method torch.jit.trace.Can anyone help?

Sorry, it was my mistake. The reason for the difference in accuracy between the PyTorch C++ API and Python is because I made an error in the data preprocessing step of the C++ version.