zhanghang1989 / PyTorch-Encoding

A CV toolkit for my papers.
https://hangzhang.org/PyTorch-Encoding/
MIT License
2.04k stars 450 forks source link

Training in custom ADE20K-like data #374

Closed JJavierga closed 3 years ago

JJavierga commented 3 years ago

Hello, I want to train in my own data which is kind of ADE20K style. It has two classes and each pixel has a value 1 or 53 depending on the class it is. I tried to use the segmentation/train_dist.py in my dataset like:

python experiments/segmentation/train_dist.py --dataset ade20k --model deeplab --aux --batch-size 2 --epochs 200 --lr 0.1

Taking into account that I have substitued the images in the ADE20K folders with mine and deleted the assertions that checks that the number of images is that of ADE20K.

But the results I get are a train loss of NaN and, if I use classes 0 and 1 instead, it goes to 0.000 but it predicts the whole picture to be a single label.

Do you have any idea why? Is it because there are too many classes and I am trying to use just 2 of them? Or is there any possible conceptual mistake that I am making?

Thanks