-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There are different objects after class dataset and dataloader #624
Comments
@ykhsiao25 using all default settings if I put print the len() of each I get # Dataset
dataset = LoadImagesAndLabels(train_path,
img_size,
batch_size,
augment=True,
hyp=hyp, # augmentation hyperparameters
rect=opt.rect, # rectangular training
image_weights=opt.img_weights,
cache_labels=True if epochs > 10 else False,
cache_images=False if opt.prebias else opt.cache_images)
print(len(dataset))
# Dataloader
dataloader = torch.utils.data.DataLoader(dataset,
batch_size=batch_size,
num_workers=min([os.cpu_count(), batch_size, 16]),
shuffle=not opt.rect, # Shuffle=True unless rectangular training is used
pin_memory=True,
collate_fn=dataset.collate_fn)
print(len(dataloader)) |
@ykhsiao25 can you reproduce your issue on one of the available datasets like coco.data or coco_64img.data? |
@ykhsiao25 also if you could supply a minimum reproducible example with code this would help. |
@glenn-jocher Thanks for your response! coco.data
And code
|
@ykhsiao25 if |
Hello,
I got some bugs when I train my dataset.
Did you have the same problem about this?
Describe the bug
After putting my images and labels into dataset, there are still 24 objects.
(In train.py dataset = LoadImagesAndLabels(train_path,...) )
But after putting dataset into dataloader, there are just 22 objects
(In train.py dataloader = torch.utils.data.DataLoader(dataset,...))
I have checked "getitem() function ", and there is no problem about this. (Still 24 objects)
I think it's "collate_fn() function" problem because I get 22 objects here,too.
Just want to know it's really a bug(multi_processing?? or others), or I make something wrong.
Thanks a lot in advance.
The text was updated successfully, but these errors were encountered: