Why can't I specify the correct NumPy size? In the network (model of Keras, Sequential), the input layer must have 4 neurons. The input must be 1 list, the length of which is 4, each element is a number.
print(&quot;SHAPE:&quot;, np.array([1, 1, 1, 1]).shape)

self.model.fit(np.array([1, 1, 1, 1]),
self.rightAnswer, 
epochs = 1,
batch_size = 1)

Here is the conclusion:
SHAPE: (4,)

ValueError: Error when checking input: expected dense_1_input to have shape (4,) but got array with shape (1,)

Why is this happening, and how can I fix it?
Keras needs you to pass one more dimension than it says in the error message: the batch dimension.
I.e.
If you have a model that requires each sample to have an input shape of (4,) and you have 1000 training samples you need to feed it with an array of (1000, 4).
In your case since you want to feed it with just one sample you need to pass a shape of (1, 4). Try self.model.fit(np.array([[1, 1, 1, 1]])) (notice the one extra bracket with makes the array's shape be (1, 4)) .