ValueError: Layer ‘functional_45’ expected 3 input(s). Received 1 instead. Trouble with passing validation dataset

I am new to Tensorflow and kKeras and I am trying to create a neural network as mentioned in the keras website.
I am trying to create a baseline model with a dataset of my own.
The codes are exactly the same except for a few modification in the fit function like

 model.fit([X_input['Name-1'],X_input['Name-2'],X_input['Name-3']],y_output, epochs=num_epochs, validation_data=test_dataset)

and I’ve completly removed the get_train_test_splits from the above mentioned guide and I’ve written a code which gives me a testing and traning set as a dataframe

Here X_input has the X values for training and the test_dataset has both the X and Y values for testing

Whenever I run the model I get the following output

Start training the model...
Epoch 1/400
1/1 ━━━━━━━━━━━━━━━━━━━━ 0s 531ms/step - loss: 4177056.7500 - root_mean_squared_error: 2043.7849

And then immediately an error will throw up saying

ValueError: Layer 'functional_45' expected 3 input(s). Received 1 instead.

I checked the shape of X_input and it is (32,3)
I tried giving it a nested list of size 32 and it too doesn’t work

When I tried removing the validation data it worked but without validation, the rmse error became constant. I’ve narrowed the problem down to the point but I couldn’t rectify it.The shape of validation set is (8,5)

I cant figure out how to feed inputs to these networks.
I used the dataset in the page and included the get_train_test_splits and it worked fine.

Here’s the full error stack if anyone needs it

ValueError                                Traceback (most recent call last)
Cell In[81], line 3
      1 mse_loss = keras.losses.MeanSquaredError()
      2 baseline_model = create_baseline_model()
----> 3 run_experiment(baseline_model, mse_loss, train_dataset, test_dataset)

Cell In[80], line 14, in run_experiment(model, loss, train_dataset, test_dataset)
      7 model.compile(
      8     optimizer=keras.optimizers.RMSprop(learning_rate=learning_rate),
      9     loss=loss,
     10     metrics=[keras.metrics.RootMeanSquaredError()],
     11 )
     13 print("Start training the model...")
---> 14 model.fit([X_input['Name-1'],X_input['Name-2'],X_input['Name-3']],y_output, epochs=num_epochs, validation_data=test_dataset)
     15 print("Model training finished.")
     16 _, rmse = model.evaluate(train_dataset, verbose=0)

File ~AppDataLocalProgramsPythonPython311Libsite-packageskerassrcutilstraceback_utils.py:122, in filter_traceback.<locals>.error_handler(*args, **kwargs)
    119     filtered_tb = _process_traceback_frames(e.__traceback__)
    120     # To get the full stack trace, call:
    121     # `keras.config.disable_traceback_filtering()`
--> 122     raise e.with_traceback(filtered_tb) from None
    123 finally:
    124     del filtered_tb

File ~AppDataLocalProgramsPythonPython311Libsite-packageskerassrclayersinput_spec.py:156, in assert_input_compatibility(input_spec, inputs, layer_name)
    154 inputs = tree.flatten(inputs)
    155 if len(input_spec) != len(inputs):
--> 156     raise ValueError(
    157         f"Layer '{layer_name}' expected {len(input_spec)} input(s). "
    158         f"Received {len(inputs)} instead."
    159     )
    160 for x in inputs:
    161     # Having a shape/dtype is the only commonality of the various
    162     # tensor-like objects that may be passed. The most common kind of
    163     # invalid type we are guarding for is a Layer instance (Functional API),
    164     # which does not have a `shape` attribute.
    165     if not hasattr(x, "shape"):

ValueError: Layer 'functional_45' expected 3 input(s). Received 1 instead.

New contributor

United Dragons is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật