This is NOT MY code by here is the line, where it shows a problem:
model.fit(trainX, trainY, batch_size=2, epochs=200, verbose=2)
(As I am thinking now, it i
UnboundLocalError: local variable 'batch_index' referenced before assignment
The reason for the problem is that the list of batches is empty! batches ==[]
The reason it is blank is because the number of samples for training data is too small to be divided by batch_size
You should check your data, number of samples or You should reduce batch_size to a point that allows you to divide the number of samples by batch size with a real result..