Can i take batch_size = 3 rather then 5 in the dataloader ??

batch_size=5

train_dl=DataLoader(train_ds,batch_size,shuffle=True)

You can, batch_size can be 1 too. But as a rule of thumb its better to fit larger batches to get more generalization

2 Likes

Please why cant my batch_size exceed 5?

State what happens when you have batch size greater than 5.

1 Like

it still returns an array of 5 .

okay i think it is everything is working fine now. i restarted the kernel