Hi,
Usually a validation set is a subset of a whole dataset which means the structure of both training and validation should be consistent as you know. Could you please show a sample of your training set and validation set to track the issue? As you commented in your validation code, we can play with view ,etc but first, you need to make sure the data is transformed reliably.