chen0040 / keras-english-resume-parser-and-analyzer

keras project that parses and analyze english resumes
MIT License
272 stars 144 forks source link

Cannot train model #4

Closed ashoknar closed 6 years ago

ashoknar commented 6 years ago

ValueError: You are passing a target array of shape (3, 1) while using as loss categorical_crossentropy. categorical_crossentropy expects targets to be binary matrices (1s and 0s) of shape (samples, classes). If your targets are integer classes, you can convert them to the expected format via:

from keras.utils import to_categorical
y_binary = to_categorical(y_int)

Alternatively, you can use the loss function sparse_categorical_crossentropy instead, which does expect integer targets.

ashoknar commented 6 years ago

I have tried to train the model using varying number of input files. The error is the same, only the array shape shown above changes.

ashoknar commented 6 years ago

The error occurred because there wasn't enough fields labeled as header in the training data. At least one header field must be specified in each training set.

saipavanmeruga commented 5 years ago

Please elaborate on this issue and how you solved this. I am using 5 input files to train my model and it has skills as the only header after annotation