Hi Patrick,
I figure it out the error, it turns out when you use the data. random split the train loader becomes a dataset. The elegant solution is to pass these datasets into the loaders again. By doing this, there are 2 gains, first, you can enjoy the benefits of data loader rather than do iterations because the datasets don’t carry the batch information. Please see below my transformation, followed by the reload. Hopefully, it can help others with the same issue. On a side note, the image classification did not result in very good accuracy. Also as usual, thanks for taking the time to help.
Here the data is split - it loses all the goodies of the data loader
train loader, val_loader = torch.utils.data.random_split(loader.dataset, (153, 39))
But as a test I put back into data loader and worked really well
## Create a Image folder
#
train_dataset = torchvision.datasets.ImageFolder(
root= data_path,
transform = data_transforms,
target_transform=None)

## Load into a older
#
loader = DataLoader(
train_dataset,
batch_size=32,
num_workers=0,
shuffle=True)

## Split randomly
#

trainloader, valloader = torch.utils.data.random_split(loader.dataset, (153, 39))
type(trainloader)
## Load back into data loaders as train and val sets
#
train_loader = DataLoader(
trainloader,
batch_size=1000,
num_workers=0,
shuffle=True)

val_loader = DataLoader(
valloader,
batch_size=1,
num_workers=0,
shuffle=False)