Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model.fit() should tell you if batch is not big enough to train with #48708

Open
isaacgerg opened this issue Apr 22, 2021 · 7 comments
Open

model.fit() should tell you if batch is not big enough to train with #48708

isaacgerg opened this issue Apr 22, 2021 · 7 comments
Assignees
Labels
comp:keras Keras related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower TF 2.4 for issues related to TF 2.4 type:feature Feature requests

Comments

@isaacgerg
Copy link

isaacgerg commented Apr 22, 2021

Suppose you train a model using model.fit() and your batch size is set to N. If the input from a generator is < N, tf keras gives the following error which is difficult to interpret: ValueError: Expect x to be a non-empty array or dataset.

Reference second answer in : https://stackoverflow.com/questions/63231811/valueerror-expect-x-to-be-a-non-empty-array-or-dataset-tensor-flow-lite-model

Propose to have tf keras tell user that batch size is larger than data size in place of current error. The current error implies that the x is empty which isnt this case for all x with size less than N.

@tilakrayal tilakrayal added comp:keras Keras related issues type:support Support issues labels Apr 23, 2021
@tilakrayal
Copy link
Contributor

@isaacgerg ,

In order to expedite the trouble-shooting process, could you please provide the Tensorflow version,complete code and dataset to reproduce the issue reported here.

Thanks!

@tilakrayal tilakrayal added the stat:awaiting response Status - Awaiting response from author label Apr 23, 2021
@isaacgerg
Copy link
Author

Tensorflow 2.4.1

@tilakrayal tilakrayal added TF 2.4 for issues related to TF 2.4 and removed stat:awaiting response Status - Awaiting response from author labels Apr 26, 2021
@tilakrayal
Copy link
Contributor

@isaacgerg ,

Could you please provide the complete code and dataset or colab link to reproduce the issue reported here.

@tilakrayal tilakrayal added the stat:awaiting response Status - Awaiting response from author label Apr 26, 2021
@isaacgerg
Copy link
Author

@tilakrayal See the stack overflow link in the original post.

@tilakrayal tilakrayal removed the stat:awaiting response Status - Awaiting response from author label Apr 29, 2021
@tilakrayal tilakrayal assigned Saduf2019 and unassigned tilakrayal Apr 29, 2021
@Saduf2019 Saduf2019 added the comp:lite TF Lite related issues label Apr 29, 2021
@Saduf2019
Copy link
Contributor

@isaacgerg
You set a batch size and then enter input less than batch size it would be treated as empty, you cannot have that.
We cannot have issues to fix user code as this repo is for performance issues and feature request or bugs only.

@Saduf2019 Saduf2019 added the stat:awaiting response Status - Awaiting response from author label Apr 29, 2021
@isaacgerg
Copy link
Author

@Saduf2019 Please read the original issue carefully and note my proposal.

@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

@google-ml-butler google-ml-butler bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label May 6, 2021
@ymodak ymodak added type:feature Feature requests and removed comp:lite TF Lite related issues stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author type:support Support issues labels May 6, 2021
@Saduf2019 Saduf2019 assigned ymodak and unassigned Saduf2019 May 6, 2021
@ymodak ymodak added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:keras Keras related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower TF 2.4 for issues related to TF 2.4 type:feature Feature requests
Projects
None yet
Development

No branches or pull requests

4 participants