ufunc 'true_divide' not supported for the input types, and the inputs could not be safely coerced to any supported types error

Viewed 1160

I try to resize the image for X_train then adding to array these resized images but I got this error; ufunc 'true_divide' not supported for the input types, and the inputs could not be safely coerced to any supported types error. Can you help me how can i fix it ?

input_shape = (48,48,3)
imgs_dataset = pd.read_csv('/home/x/driver_imgs_list.csv')

X=imgs_dataset[['img','subject']]
y=imgs_dataset['classname']

X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.4,random_state=101)
X_train_resized = []
for img in X_train:
    X_train_resized.append(np.resize(img,input_shape) / 255)
0 Answers
Related