I'm following a tutorial on YouTube (https://www.youtube.com/watch?v=y1ZrOs9s2QA&feature=youtu.be), the code can be found here: https://github.com/murtazahassan/Digits-Classification/blob/master/OCR_CNN_Trainning.py
But when I try to run the code below, I get the error: TypeError: only integer scalar arrays can be converted to a scalar index.
x_train = np.array(list(map(preprocess, x_train)))
x_test = np.array(list(map(preprocess, x_test)))
x_validation = np.array(list(map(preprocess, x_validation)))
x_train = x_train.reshape(x_train[0], x_train[1], x_train[2], 1)
x_test = x_test.reshape(x_test[0], x_test[1], x_test[2], 1)
x_validation = x_validation.reshape(x_validation[0], x_validation[1], x_validation[2], 1)
I found this (TypeError: only integer scalar arrays can be converted to a scalar index , while trying kfold cv) and this (TypeError when indexing a list with a NumPy array: only integer scalar arrays can be converted to a scalar index), but it did not help me. What am I doing wrong?
name.dtypefor all the arrays?