wasidennis / AdaptSegNet

Learning to Adapt Structured Output Space for Semantic Segmentation, CVPR 2018 (spotlight)
847 stars 203 forks source link

Training on custom dataset #78

Closed Aayushktyagi closed 4 years ago

Aayushktyagi commented 4 years ago

Hi , Thanks @hfslyc for sharing code. I am trying to run the network on the custom dataset. My dataset contains binary mask. I created custom data loader for both source and target. I am facing issue with loading model. 1) I used deep labs with single class I am getting the following error while I am using deep labs with num_classes = 1

Screenshot from 2020-01-27 15-56-10

when model loading structure was Screenshot from 2020-01-27 17-39-07

2) Can you please guide me which changes need to be done when training model from scratch. Screenshot from 2020-01-27 16-01-08

Thanks in advance Aayush

Originally posted by @Aayushktyagi in https://github.com/wasidennis/AdaptSegNet/issues/1#issuecomment-578686821

hfslyc commented 4 years ago

Hi,

for 1, I think you should set the NUM_CLASSES to 2 for a binary mask. Also, please make sure that the gt labels are 0 and 1 instead of the other number.

for 2, if you really want to train from scratch (not using imagenet pretrained model), you could simply comment out all the model.load_state_dict(.)