keras icon indicating copy to clipboard operation
keras copied to clipboard

Check for empty input array

Open Vishu26 opened this issue 2 years ago • 5 comments

Added assertion for checking empty input array in Model.fit function. Closes: #16202

Vishu26 avatar Mar 10 '22 13:03 Vishu26

Thanks for the PR.

First of all we should fix the current error message:

ValueError: Unexpected result of train_function (Empty logs). Please use Model.compile(..., run_eagerly=True), or tf.config.run_functions_eagerly(True) for more information of where went wrong, or file a issue/bug to tf.keras.

Update to:

ValueError: Unexpected result of train_function (Empty logs). Try using Model.compile(..., run_eagerly=True) for easier debugging of what went wrong.

Second, to display a more specific error message we should add the error code in data_adapter.py so that it gets raised here: data_handler = data_adapter.get_data_handler(...)

Third, in order to raise an error message we should use ValueError, not assert.

fchollet avatar Mar 10 '22 17:03 fchollet

@fchollet Thank you for reviewing. I have updated the error message both in the train_function and predict_function in this PR. Plus added the specific error message in data_adapter.get_data_handler(...).

Vishu26 avatar Mar 11 '22 10:03 Vishu26

@Vishu26 Can you please check @qlzh727's comments and keep us posted ? Thank you!

gbaned avatar Jun 10 '22 16:06 gbaned

Hi @gbaned ! Is it enough to use if else checks for iterator and dataset?

Vishu26 avatar Jun 10 '22 17:06 Vishu26

@qlzh727 Can you please assist on above comments from @Vishu26. Thank you!

gbaned avatar Aug 05 '22 07:08 gbaned

Hi @qlzh727 Any update on this PR? Please. Thank you!

gbaned avatar Dec 16 '22 13:12 gbaned

Hi all,

Is there a solution which can resolve this issue?

SJYinda avatar Mar 17 '23 17:03 SJYinda

Hi @Vishu26 Can you please resolve conflicts? Thank you!

gbaned avatar Apr 13 '23 10:04 gbaned

This PR is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.

github-actions[bot] avatar Apr 28 '23 01:04 github-actions[bot]

This PR was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further.

github-actions[bot] avatar May 13 '23 01:05 github-actions[bot]