def cnn_data(data): x, y = data.shape[1:] return data.reshape((-1, x, y, 1))
We introduce this function used in the following code.
it seems like you data has 2 dimensions, so data.shape[1:] is only one integer. Hence the error message
In this line of code x and y are two values while data.shape is producing only one value:
x
y
data.shape
x, y = data.shape[1:]