“ ValueError: Shapes (None, 3) and (None, 4) are incompatible”

Sample output error:

ValueError: Shapes (None, 3) and (None, 4) are incompatible

Code hints:

 

As you can see from the prompt, the error starts from the fit() function, so the next step is to check where the error occurred:

Analysis: Generally, the error xx and xx do not match, and the first line of the code indicated by the error message appears in the fit() training function, then the high probability at this time is the number of neurons in the output layer you set and the type of training data Not equal, that is to say: suppose the number of sample categories of your training data is 3, and the number of output neurons you set≠3, such an error will occur!

(The above content is a summary of learning!) 

Guess you like

Origin blog.csdn.net/qq_58611650/article/details/129171763