Open aoussou opened 6 years ago
Hi @nayriz . Thank you for reporting. That's a bug, change this line in your notebook:
logits_flatten = flatten_logits(logits, number_of_classes=21)
In your case, number_of_classes=2
Let me know if that works
Dear Daniil,
Thank you for your prompt reply. I had already changed that line. I have also changed the following lines:
fcn = resnet_dilated.Resnet34_8s(num_classes=2)
and
number_of_classes = 2
labels = range(number_of_classes)
Did you mean to say I should leave those unchanged and only change the line your mentioned?
Thanks alot!
Did that help to resolve your problem? You should change everything related to number of classes.
Also check this file: https://github.com/warmspringwinds/pytorch-segmentation-detection/blob/master/pytorch_segmentation_detection/recipes/endovis_2017/segmentation/resnet_18_8s_train.ipynb
It's a training file for a different dataset where we performed binary segmentation (similar to your problem).
I had already done that when I submitted the issue, so I guess it doesn't solve my problem.
Thank you for pointing out at the other notebook, I'll definitely have a look at it!
Great! Try it out.
Also bear in mind that your labels should be 0 and 1 (background and your class) in the annotations and 255 for regions that you want to ignore.
and let me know if you need more help
Thanks a lot, when you say
your labels should be 0 and 1 (background and your class) in the annotations
you mean for the endovis files, right? For the Pascal Voc the labels should be the class number.
Also, it is possible to train the model with resnet_34_8s, right?
@nayriz I mean that depending on the number of classes in your own dataset you should change all the related variables.
Yes, in Endovis we did it with 2 classes and I thought it might be easier for you as you mentioned that your dataset has 2 classes. And yes, it is possible to do 2 classes with resnet_34
Sorry, the structure is a little bit messy so far -- I will change that in a future.
Hi there,
First, thanks a lot for the good work, it's really useful!
I am trying to train the model on 1 only one class (that class + background) using the code in resnet_34_8s_train.ipynb in a .py file . I am confident my dataset only has one class, so I change the number of class from 21 to 2, but I get the following error after when starting the first iteration:
RuntimeError: cuda runtime error (59) : device-side assert triggered at /opt/conda/conda-bld/pytorch_1518238441757/work/torch/lib/THC/generic/THCStorage.cu:58
I just wanted to make sure that for only 1 class, I should set number_of_classes = 2 instead of 21, and that you are able to make work with you home code work with a different number of classes? The full error is below: