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 : Working with a small amount of data for binary classification in neural networks
- python : RESOURCEEXHAUSTEDERRORRORR ERROR During neural network training
- python : Attempt to get argmax of an Empty Sequence ARGMAX value remains empty and can not be executed.
- python : AttributeError: Module 'numpy' has no attribute 'Bool_'
- python : Valueerror error: Invalid Literal for int () with Base 10 When running Estimator.Train string (input_fn= train_input_fn
- python : 95% Accuracy Predicts Wrong Class (Multiclass Classification Kaggle GTSRB -German Traffic Sign Recognition Benchmark)
- python : TensorFlow Cudart64_101.dll Not Found
- python : How to make the neural set classify the text?
- Using Weights in FIT () with Python Keras-RL
- python : Permissionerror: [errno 13] permission denied