Keras-segmentation-deeplab-v3.1 icon indicating copy to clipboard operation
Keras-segmentation-deeplab-v3.1 copied to clipboard

model only predict one label after training

Open pissw2016 opened this issue 5 years ago • 2 comments

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 avatar Jun 23 '19 12:06 pissw2016

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 avatar Jun 24 '19 12:06 pissw2016

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

tiagojc avatar Jul 08 '19 17:07 tiagojc