Tramac / Fast-SCNN-pytorch

A PyTorch Implementation of Fast-SCNN: Fast Semantic Segmentation Network
Apache License 2.0
380 stars 93 forks source link

VOC or COCO dataset model file #19

Open shivSD opened 5 years ago

shivSD commented 5 years ago

Hi,

do you support voc or coco dataset ? if not can you guide me through the training process (changes need). Or if you support please can you share model files or script to train.

thanks for your help

Tramac commented 5 years ago

Hi, this project does not contain voc and coco, this one may help you.

shivSD commented 5 years ago

Thanks for the scripts. I did use pascal_voc.py to load the data. But i'm getting into following error

Found 1464 images in the folder ../datasets/voc/VOC2012 Found 1449 images in the folder ../datasets/voc/VOC2012 w/ class balance Starting Epoch: 0, Total Epochs: 160 Traceback (most recent call last): File "train.py", line 200, in trainer.train() File "train.py", line 127, in train for i, (images, targets) in enumerate(self.train_loader): ValueError: too many values to unpack (expected 2)

Is it something to with torch version i'm using ? i tried with both torch 0.4.1 & 1.3.0 version both are giving the same issue.

I see the issue is related to this snippet of code in train.py ` for i, (images, targets) in enumerate(self.train_loader): cur_lr = self.lr_scheduler(cur_iters) for param_group in self.optimizer.param_groups: param_group['lr'] = cur_lr

            images = images.to(self.args.device)
            targets = targets.to(self.args.device)

            outputs = self.model(images)
            loss = self.criterion(outputs, targets)

            self.optimizer.zero_grad()
            loss.backward()
            self.optimizer.step()`

I appreciate any help in resolving this.

Liu6697 commented 4 years ago

Hi, @shivSD, I met the same error when use the pascal_voc.py, have you debugged it?

BhargavaRamM commented 4 years ago

@Liu6697 I think the problem is with what enumerate(self.train_loader) returns. If you notice, for city scapes dataset, __getitem__(...)method in CitySegmentation class returns (img, mask). But in Pascal VOC data loader script from above reference returns (img, mask, path). So, you will need to make sure you are unpacking all three items that __getitem__(...) methods returns when you enumerate(self.train_loader).

Something like following should work:

for i, (images, targets, _) in enumerate(self.train_loader):
....
Liu6697 commented 4 years ago

@BhargavaRamM Thanks!!!

GUESSVPN commented 3 years ago

Hi, @Liu6697 How about your trainning results on voc?