I’m not sure how you are creating the Dataset, but if you are using a custom dataset implementation and read the image - target pairs, make sure that they still correspond to each other.
I’ve seen issues in the past switching between Windows and Linux, as these platforms might be using different sorting schemata e.g. if reading files.