I'm building my first Neural Network taking as example those on the book "Deep Learning with Python - Francois Chollet" and I immediately found my first issue. When the author imported the MNIST dataset he also printed the shape, obtaining that it is a 1D tensor. I'm trying to import a folder containing all caddies images to check whether the NN catalogs them correctly or not. The problem is that I can't obtain a 1D tensor from all these images. I've tried to convert each of them with numpy.asarray(my_image)
. I also tried to convert the whole list but turns out it became a tuple... any hint?
train_label = 'Caddies'
train_images = list()
for filename in listdir('/content/drive/MyDrive/Data set/Caddies/'):
img_data = image.imread('/content/drive/MyDrive/Data set/Caddies/' +\
filename)
img_data = np.asarray(img_data)
#print(str(img_data.dtype) + str(img_data.shape))
train_images.append(img_data)
print('> loaded %s images' % (len(train_images)))
train_images = np.array(train_images)
print(train_images.shape())