Keras-segmentation-deeplab-v3.1
Keras-segmentation-deeplab-v3.1 copied to clipboard
model only predict one label after training
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.042
with 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?
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 did you solve the problem? I'm facing same issue here