Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
Google Colab[^]

The code link has been updated. Now you can access it here.
I was trying to implement smile detection project from kaggle on to my Google collab.

kaggle link
smile-detection | Kaggle[^]

I have downloaded the datasets and uploaded on my drive and mounted it so my problem is:
C++
H=model.fit(train_X,train_y,validation_data=(test_X,test_y),epochs=15,batch_size=32)

It shows this error:
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-7-094cecbab710> in <cell line:="" 1="">()
----> 1 H=model.fit(train_X,train_y,validation_data=(test_X,test_y),epochs=15,batch_size=28)

1 frames
/usr/local/lib/python3.10/dist-packages/keras/src/engine/data_adapter.py in __init__(self, x, y, sample_weight, batch_size, steps_per_epoch, initial_epoch, epochs, shuffle, class_weight, max_queue_size, workers, use_multiprocessing, model, steps_per_execution, distribute, pss_evaluation_shards)
   1317 
   1318         if self._inferred_steps == 0:
-> 1319             raise ValueError("Expected input data to be non-empty.")
   1320 
   1321     def _configure_dataset_and_inferred_steps(

ValueError: Expected input data to be non-empty.

So I tried changing the batch size to 4 16 but same error.

What I have tried:

I tried changing the batch size several times.
Posted
Updated 6-Nov-23 1:26am
v4
Comments
Richard MacCutchan 26-Oct-23 9:23am    
"it keeps showing error"
Sorry, no one here can see your screen or read your mind.
Hossain23 27-Oct-23 14:26pm    
updated the link now you can access and see the code
Richard MacCutchan 28-Oct-23 4:09am    
The message is cleaer, you have a data set that is incomplete. So you need to examine what data you are passing in to the code. This is not something anyone here can do for you.
Dave Kreskowiak 26-Oct-23 10:10am    
ERROR MESSAGES ARE THE CORE CLUES TO THE PROBLEM! Hover the mouse over your question and click the "Improve question" widget. Edit your post and add the EXACT error messages you're getting.
Hossain23 27-Oct-23 14:27pm    
updated the link now you can access and see the code

1 solution

"It doesn't work" is probably the most useless problem report we get - and we get it a lot. It tells us nothing about what is happening, or when it happens - and "I get error" means just that - "it doesn;t work"!

So tell us what it is doing that you didn't expect, or not doing that you did.
Tell us what you did to get it to happen.
Tell us any error messages.
Use the "Improve question" widget to edit your question and provide better information.

Assuming you get an error message of some sort - but we have no idea what - have a look here: How to Write Code to Solve a Problem, A Beginner's Guide Part 2: Syntax Errors[^]
It primarily deals with syntax errors, but the same logic often applies to run time errors as well if that is what you are getting.
 
Share this answer
 
Comments
Hossain23 27-Oct-23 13:35pm    
i'm really sorry for my wording. i have updated the question and you can now access to the link to my code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900