ICNet-tensorflow icon indicating copy to clipboard operation
ICNet-tensorflow copied to clipboard

Train with different NUM_CLASSES

Open An-Pan opened this issue 7 years ago • 3 comments

Hi , I want train ICNet with different NUM_CLASSES (eg NUM_CLASSES = 12).So I changed all the num_classes=19 to 12 in *.py and num_output in *.prototxt. But when I run python train.py I get error: Dimension 3 in both shapes must be equal, but are 17 and 19. Shapes are [1,1,128,12] and [1,1,128,19]. for 'conv6_cls_1/Assign' So , can you give me some advice on how to traing ICNet with different class num? And can I use icnet_cityscapes_trainval_90k.npy as pretrained model on this situation?

An-Pan avatar Dec 23 '17 12:12 An-Pan

You can use the pre-trained model by selecting restore variables. Following is the example:

restore_var = [v for v in tf.global_variables() if 'conv6_cls' not in v.name

hellochick avatar Dec 26 '17 12:12 hellochick

@hellochick Thanks ,Now I have resolve the pre-trained model problem.

An-Pan avatar Dec 29 '17 06:12 An-Pan

when I set num_classes=1 (255 for background; 0 for person), and train on my own dataset, I always got sub4 =0.000 sub24 =0.000 sub124 =0.000 ans the total loss do not change at all. what's the problem? did I miss something?

ifangcheng avatar Feb 22 '18 12:02 ifangcheng