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

fix random_flip setting

Open mathfinder opened this issue 6 years ago • 3 comments

parser.add_argument('--random_flip', default=True, type=bool, help='if horizontally flip images when training') random_flip will always be True, although we run 'python train.py --random_flip False'

mathfinder avatar Apr 10 '18 03:04 mathfinder

I CAN'T RUN IT FOR File "train.py", line 314, in 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/wdh/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call result = self.forward(*input, **kwargs) File "/home/wdh/PycharmProjects/Semantic Segmentation/pytorch-semantic-segmentation-master by hangzhaomit/models/models.py", line 34, in forward pred = self.decoder(self.encoder(feed_dict['img_data'], return_feature_maps=True)) TypeError: list indices must be integers or slices, not str

wudonghao avatar May 09 '18 14:05 wudonghao

I CAN'T RUN IT FOR File "train.py", line 314, in 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/wdh/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call result = self.forward(*input, **kwargs) File "/home/wdh/PycharmProjects/Semantic Segmentation/pytorch-semantic-segmentation-master by hangzhaomit/models/models.py", line 34, in forward pred = self.decoder(self.encoder(feed_dict['img_data'], return_feature_maps=True)) TypeError: list indices must be integers or slices, not str

had the same issue, fixed with adding "feed_dict = feed_dict[0]" at the start of forward function in SegmentationModule class in models.py. Could please some1 tell me whether it spoils the training?

shlykov2 avatar Mar 25 '19 07:03 shlykov2

i also meet the problem,but i fix the feed_dict['img_data'] to feed_dict[0]['img_data']

wjqqy avatar Apr 25 '19 08:04 wjqqy