Datasets:
Tasks:
Image Classification
Sub-tasks:
multi-class-image-classification
Languages:
English
Size:
1M<n<10M
ArXiv:
License:
25th image in train set is Gray-Scale
#2
by
doolayer
- opened
simply do this
for batch in self.source:
# Skip any None elements in the batch list
batch = [x for x in batch if x is not None]
# Resize the tensors to a common size and ensure they have the same number of channels
processed_batch = []
for item in batch:
data, label = item
# Convert single-channel images to RGB
if data.size(0) == 1:
data = data.repeat(3, 1, 1)
elif data.size(0) == 4:
data = data[:3]
processed_batch.append((data, label))