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 only predict one label after training #12

Open
pissw2016 opened this issue Jun 23, 2019 · 2 comments
Open

model only predict one label after training #12

pissw2016 opened this issue Jun 23, 2019 · 2 comments

Comments

@pissw2016
Copy link

Hi, Golbstein
With weight provided by you, the IOU and prediction is all good.(I suppose the generator is right?) But with the training weight by me , the model just predict 0 all the time.
And in training the accuracy stucked in a very low value in first epoch and never change. All accuracy being difference refers to different batch size.
np.unique(model1.predict(x))return only one value 0.042with my training weight
in generator:
np.unique(self.Y[0,:]) I got array([ 0., 1., 15., 21.], dtype=float32)
np.unique(self.SW[0,:]) I got array([0. , 0.37763503, 4.679469 , 7.2337375 ], dtype=float32) they match like{0: 0.377, 1:7.23, 15:4.67, 21:0.}
I visualize the self.X, self.y, self.SW SW seems like label and image match the label.dtype all float(including self.X).
I cant figure out what is the problem. There is only the generator need to be change, right?

@pissw2016
Copy link
Author

I found out it is the problem on loss function, I make generator produce onehot label directly and then use 'categorical_crossentropy' as loss function in compile. It is fine.

@pissw2016 pissw2016 changed the title model only predict after training model only predict one label after training Jun 27, 2019
@tiagojc
Copy link

tiagojc commented Jul 8, 2019

@pissw2016 did you solve the problem? I'm facing same issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants