As shown below, an error occurs when a model is created and trained.
Even if I read the error message, I still don't understand. .
Thanks for your guidance.
#Create model for use in neutral network model = Sequential () model.add (Dense (1000, activation = 'relu')) model.add (Dense (800, activation = 'relu')) model.add (Dense (100, activation = 'relu')) model.add (Dense (1)) # Compile the model from keras.optimizers import Adam model.compile (Adam (lr = 1e-3), loss = "mean_squared_error")
#Learning with training data and evaluating with test data (using mean square error) history = model.fit (x_train_std, y_train, batch_size = 128, epochs = 100, verbose = 1, validation_data = (x_test_std, y_test))
The following is an error message.
-------------------------------------------- ------------------------------- ValueError Traceback (most recent call last) <ipython-input-32-5a6b2d63d428>in<module> 1 # Learn with training data and evaluate with test data (using mean square error) 2 ---->3 history = model.fit (x_train_std, y_train, batch_size = 128, epochs = 100, verbose = 1, validation_data = (x_test_std, y_test)) C: \ python \ anaconda \ pgm \ lib \ site-packages \ keras \ engine \ training.py in fit (self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch , steps_per_epoch, validation_steps, ** kwargs) 950 sample_weight = sample_weight, 951 class_weight = class_weight, ->952 batch_size = batch_size) 953 # Prepare validation data. 954 do_validation = False C: \ python \ anaconda \ pgm \ lib \ site-packages \ keras \ engine \ training.py in _standardize_user_data (self, x, y, sample_weight, class_weight, check_array_lengths, batch_size) 700 'either a single' 701 'array or a list of arrays.' ->702 'You passed: y =' + str (y)) 703 # Typecheck that all inputs are * either * value * or * symbolic. 704 if y is not None: ValueError: Please provide as model targets either a single array or a list of arrays.You passed: y = MEDV 80 28.0 426 10.2 316 17.8 63 25.0 25 13.9 68 1
Answer # 1
Is it in pandas DF?
Please change it to a one-dimensional array.
- 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 - in raspberry pi, the error occurs only in the case of the automatic start program using systemd
- python - about hamiltonian neural networks
- 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
- python 3x - best estimator: i get an error with no syntax, so please tell me what to do
- python - sklearn, svm error
- python - reinforcement learning of tag does not go well with open ai gym
- [python] i don't know how to solve the error
- 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 3x - error after changing to csv file
- python - error in image binarization using cv2adaptivethreshold function
- python - an error occurs in the if statement program that compares the size of numbers