The C++ result looks interleaved, which is often caused by a wrongly used view or reshape where a permute would be needed.
I don’t see any data processing code posted, but I would guess that you are using PIL in Python to load the image (channels-first by default) and OpenCV in C++ (channels-last). In C++ you might have been running into a shape mismatch error and tried to use view/reshape to create an input tensor of [batch_size, channels, height, width]. If so, use permute to permute the axes to create a channels-first tensor.