semantic-segmentation-pytorch icon indicating copy to clipboard operation
semantic-segmentation-pytorch copied to clipboard

Training on ADE20K

Open loveis98 opened this issue 5 years ago • 5 comments

Hello! I try to train default models from train.py on ADE20K, but I see such error:

Input arguments:
weights_decoder  
batch_size_per_gpu 2
weights_encoder  
workers          16
lr_pow           0.9
seed             304
epoch_iters      5000
weight_decay     0.0001
root_dataset     ./data/
list_train       ./data/train.odgt
optim            SGD
num_epoch        20
ckpt             ./ckpt
list_val         ./data/validation.odgt
id               baseline
imgMaxSize       1000
deep_sup_scale   0.4
fix_bn           False
lr_encoder       0.02
gpus             0
beta1            0.9
random_flip      True
num_class        150
start_epoch      1
imgSize          [300, 375, 450, 525, 600]
arch_decoder     ppm_deepsup
disp_iter        20
padding_constant 8
segm_downsampling_rate 8
lr_decoder       0.02
fc_dim           2048
arch_encoder     resnet50dilated
Model ID: baseline-resnet50dilated-ppm_deepsup-ngpus1-batchSize2-imgMaxSize1000-paddingConst8-segmDownsampleRate8-LR_encoder0.02-LR_decoder0.02-epoch20
# samples: 20210
1 Epoch = 5000 iters
Traceback (most recent call last):
  File "train.py", line 325, in <module>
    main(args)
  File "train.py", line 200, in main
    train(segmentation_module, iterator_train, optimizers, history, epoch, args)
  File "train.py", line 37, in train
    loss, acc = segmentation_module(batch_data)
  File "/home/ponomareva/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/ponomareva/semantic-segmentation-pytorch/models/models.py", line 34, in forward
    (pred, pred_deepsup) = self.decoder(self.encoder(feed_dict['img_data'], return_feature_maps=True))
TypeError: list indices must be integers or slices, not str

loveis98 avatar Apr 27 '19 21:04 loveis98

I also encountered the same problem. Is there any solution?

zhukaii avatar Apr 29 '19 07:04 zhukaii

Training should be done on mutiple GPU's. Refer #41

komms avatar May 15 '19 10:05 komms

@loveis98 Our customized DataParallel only supports multi-gpu training. But in the upcoming version (distributed branch), single-gpu training will be supported.

hangzhaomit avatar Jul 24 '19 21:07 hangzhaomit

@hangzhaomit thanks your help and now this project supports single gpu?

ShihuaiXu avatar Sep 12 '19 08:09 ShihuaiXu

@loveis98 You might want to try this: https://github.com/CSAILVision/semantic-segmentation-pytorch/issues/203#issuecomment-562524601

adityashrm21 avatar May 20 '20 19:05 adityashrm21