How did you load the image in C++?
If you’ve used OpenCV, note that the default color channel format is BGR, while torchvision uses PIL by default, which is using RGB.
If that might be the case, then you would have to convert the color channels in your C++ implementation.