I’ve implemented a image classification model that trains well. I have then moved onto doing image augmentation at training time via gluon.data.vision package a la
transform_train = transforms.Compose([
# Randomly flip the image horizontally
transforms.RandomFlipLeftRight(),
# Randomly flip the image horizontally
transforms.RandomFlipTopBottom(),
# Randomly jitter the brightness, contrast and saturation of the image
transforms.RandomColorJitter(brightness=0.1, contrast=0.1, saturation=0.1),
# Randomly adding noise to the image
transforms.RandomLighting(0.1)
])
then
train_data = gluon.data.ArrayDataset(train_X, train_Y)
train_iter = gluon.data.DataLoader(train_data.transform_first(transform_train),
BATCHSIZE, shuffle=True)
When calling
for i (data, label) in enumerate(train_iter):
some_task()
I get the following error
AssertionError: HybridBlock requires the first argument to forward be either Symbol or NDArray, but got <class ‘numpy.ndarray’>
Any idea how to fix this?