nole
April 15, 2020, 4:08pm
1
Running this code:
bears = bears.new(item_tfms=RandomResizedCrop(128, min_scale=0.3))
dls = bears.dataloaders(path)
dls.train.show_batch(max_n=4, nrows=1, unique=True)
Returns:
ValueError: This DataLoader does not contain any batches
I have run all code before, run dls.train.items
and there are items in the dataloader but no batches.
8 Likes
Hi, I had the same problem, it came out because I was only testing a few images, the batch size is by default bs = 64. If you change that value for a lower one, it will work.
dls = bears.dataloaders(path,bs=5)
dls.show_batch(nrows=1, ncols=3)
15 Likes
dysonlin
(Dyson Lin)
September 4, 2020, 11:40pm
3
yesssicavalencia:
,bs=5
Thanks! I got the same problem yesterday.
1 Like
ascyrax
(SURAJ SINGH RAMAN)
November 20, 2020, 6:50am
4
i was doing the same mistake. lol . i had a training set of 42000 images but i loaded just 10 of them in the datablock…
DahVip
July 29, 2021, 7:40pm
5
Thank you, that solved it.
rgh
(rgh)
November 29, 2022, 5:52am
7
yesssicavalencia:
bs=5
dear @yesssicavalencia
thanks a lot for your answer*
Thanks dear, bs = 5 worked!