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 not learning anything #152

Open
anmol4210 opened this issue Jun 6, 2021 · 1 comment
Open

Model not learning anything #152

anmol4210 opened this issue Jun 6, 2021 · 1 comment

Comments

@anmol4210
Copy link

anmol4210 commented Jun 6, 2021

Hi
I'm training DeepLabV3+ Mobilenet backbone on my custom dataset. My Dataset has 1 class. My Model architecture looks like:

deeplab_model = Deeplabv3(input_shape=(512, 512, 3), classes=2,activation='softmax') deeplab_model.compile(optimizer='adam', loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),metrics='accuracy']) deeplab_model.fit(...)

My Loss is not reducing and the output is all black. My mask is of the shape (512,512)
Someone, please guide me what to do? Any help would be great.

@YuriyKortev
Copy link
Contributor

Hello, try to use classes argument equal to 1 and activation argument equal to 'sigmoid', then use np.reshape on your mask with shape argument equal to (512, 512, 1). Also try to use some loss functions useful for semantic segmentation, dice loss for example

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