In U-Net, generally the patch sizes are determined in accordance with the subsequent max-pool layers, so that the down-sampling by factor of 2 at each max-pool layer goes smoothly and training goes well. Hence, to make the training smoother, it is important to determine a proper patch size and use the same for all input training samples irrespective of their original dimensions.
From the problem you are facing, it seems that your U-net architecture is defined to take the input patches of size (64X64X32). Hence, when you are trying feed patches of different size than this, it is throwing error.
If the network architecture is a pre-defined one, then you should use the defined input patch size for training.
If the network is defined by you, then you should change the input dimension in ‘imageInputLayer’ of ‘layers’ object to your desired one and then feed to ‘trainNetwork’ function.
Hope this will help you.