This should be working as i have seen it work on anothers however this is not working for me. I am doing a test/train model and trying to train the image
This is all that i have tried. Data saved on google drive
train_image = []
for i in tqdm(range(train.shape[0])):
img = image.load_img('/content/drive/My Drive/Colab Notebooks/data/train/'+train['file_id'][i], target_size=(128,173,1), color_mode='grayscale')
img = image.img_to_array(img)
img = img/255
train_image.append(img)
x_train = np.array(train_image)
0%| | 0/5377 [00:00<?, ?it/s]
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-ef9f3fb90a16> in <module>()
1 train_image = []
2 for i in tqdm(range(train.shape[0])):
----> 3 img = image.load_img('/content/drive/My Drive/Colab Notebooks/data/train/'+train['file_id'][i], target_size=(128,173,1), color_mode='grayscale')
4 img = image.img_to_array(img)
5 img = img/255
TypeError: must be str, not numpy.int64