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
UnboundLocalError if input is a Dataframe #8290
UnboundLocalError if input is a Dataframe #8290
Conversation
Please add a corresponding unit test. |
I can't seem find a use case for the test. Whenever I pass a dataframe, it fails a dimension check. Looks like |
This test includes testing Pandas dataframes as model inputs: https://github.com/fchollet/keras/blob/master/tests/keras/engine/test_training.py#L94 |
I examined that function. It only ever passes lists of dataframes as
input -- which effectively adds one dimension and changes the type.
While the faulty line only triggers when I pass a Dataframe directly.
I could pass it anyway and only check that it fails with something
_other_ that UnboundLocalError...
That's really a last resort though.
The OP of the linked SO question didn't bother to give a sample input,
so I've no idea what it could possibly be.
I only barely understand the library's workings (from my small
theoretical background on neural networks), all I did is fix an obvious
typo to address the OP's problem (and they confirmed I did by accepting
the answer).
|
If the current tests are insufficient, please add proper tests. All changes to the codebase should be tested. |
is it merged now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it is right.
@icyblade , what use cases did you have in mind when you wrote that chunk of code? |
@native-api Thanks for your contribution. It seems to be a typo of my PR #8199, and as the unit test of my PR didn't cover everything, this bug was merged into master. My bad :-( @fchollet Should I create a new PR including the typo fix and new unit test, or instruct @native-api in this PR? |
@icyblade: please open a new PR to add unit tests. I'll merge this one. |
See https://stackoverflow.com/questions/46999519/keras-model-fit-unboundlocalerror