I want to do deep learning, but I don't know how to solve the error.
Corresponding source code
ValueError: Error when checking target: expected dense_4 to have shape (1,) but got array with shape (2,)
Dense related part
model = Sequential ([Dense (40, activation = "relu", input_dim = 66), Dropout (0.2), Dense (20, activation = "relu"), Dropout (0.2), Dense (10, activation = "relu"), Dropout (0.2), Dense (4, activation = "softmax")]) model.compile (optimizer = "adam", loss = "sparse_categorical_crossentropy" , metrics = ["accuracy"]) hist = model.fit (X_train, y_train, batch_size = 47, epochs = 100, verbose = 2) model.summary ()
What exactly does shape mean?
Answer # 1
finished. Thank you very much.
- i don't know how to solve python's formation error
- i want to solve the error "runtime error: event loop is closed" that occurred when i made a bot in python
- python - i want to solve the problem that i get the error typeerror: xxxxxxxx takes no arguments
- python - the py file cannot be executed in the task scheduler 0x2 error
- python - i get an error when connecting to a voice channel with discordpy
- python - categorical_crossentoropy error does not resolve
- readcsv error in python
- python - i want to display an image with pysimplegui, but an error occurs
- python - error when scraping with selenium and firefox
- [python] graphviz output format error
- i get an error when deploying to heroku i want to solve it
- python 3x - best estimator: i get an error with no syntax, so please tell me what to do
- c ++ - i want to know how to solve the error "undefined xref"
- github - i am a beginner git push can't solve the error! help me!
- python - an error has occurred in yolo v3
- python - idle cannot resolve the "rootgeometry" error
- python - tuple error does not resolve
- python max () arg is an empty sequence and an error occurs and it cannot be processed well
- python - in raspberry pi, the error occurs only in the case of the automatic start program using systemd
- python : Please tell me why the code doesn't work
- python : how to connect embedding layer with size (3.50) to lstm?
- python : The loss function returns nan
- python : How to apply optimization to image in tensorflow so that neural network output is high?
- python : How to set up random seed in Tensorflow?
- python : tf.test.is_gpu_available ()) returns False
- Issue in python command object_detection /builders /model_builder_tf2_test.py