mohitzsh / Adversarial-Semisupervised-Semantic-Segmentation

Pytorch Implementation of "Adversarial Learning For Semi-Supervised Semantic Segmentation" for ICLR 2018 Reproducibility Challenge
155 stars 45 forks source link

What is prefix? #10

Closed manbp closed 5 years ago

manbp commented 5 years ago

I am trying to run the train file. In the code there is a line,-

parser.add_argument("prefix", help="Prefix to identify current experiment")

What should be the argument "prefix", we need to provide?

mohitzsh commented 5 years ago

This is just an identifier I used to keep track of experiments. Any value should work.

manbp commented 5 years ago

Thank you so much for the reply. One more question I want to ask. In the dataset directory If i provide only the .jpg file of PASCAL VOC 2012 data, will it work? Actually I am getting an error like this:

Traceback (most recent call last): File "C:/Users/hp/PycharmProjects/new_for_3.5/Adversarial-Semisupervised-Semantic-Segmentation-master/Adversarial-Semisupervised-Semantic-Segmentation-master/train.py", line 515, in main() File "C:/Users/hp/PycharmProjects/new_for_3.5/Adversarial-Semisupervised-Semantic-Segmentation-master/Adversarial-Semisupervised-Semantic-Segmentation-master/train.py", line 452, in main trainloader_u=DataLoader(trainset_u,batch_size=args.batch_size,shuffle=True,num_workers=2,drop_last=True) File "C:\Users\hp\Anaconda3\envs\new_for_3.5\lib\site-packages\torch\utils\data\dataloader.py", line 802, in init sampler = RandomSampler(dataset) File "C:\Users\hp\Anaconda3\envs\new_for_3.5\lib\site-packages\torch\utils\data\sampler.py", line 64, in init "value, but got num_samples={}".format(self.num_samples)) ValueError: num_samples should be a positive integeral value, but got num_samples=0

Please help me regarding this.

mohitzsh commented 5 years ago

Using .jpg files should work (look at https://github.com/ms-sharma/Adversarial-Semisupervised-Semantic-Segmentation/blob/master/datasets/pascalvoc.py#L52 for image loading).

Try to check if the dataset is being loaded correctly. I'll start by looking at https://github.com/ms-sharma/Adversarial-Semisupervised-Semantic-Segmentation/blob/master/train.py#L448.

manbp commented 5 years ago

I have dataset folder as shown in the screenshot https://gofile.io/?c=0WIEc5 . I need to provide the directories containing img (Images) and cls (GT Segmentation) folder to the code. So I tried the following code line:

 parser.add_argument("--dataset_dir", default='C:\Users\hp\Desktop\VOCtrainval_11-May-2012\VOCdevkit\VOC2012\JPEGImages', type=str,
                        help="A directory containing img (Images) and cls (GT Segmentation) folder")

But it showing the error as mentioned earlier. Please help.

mohitzsh commented 5 years ago

--dataset_dir should have two folders, img and cls, with Image files and Segmentation files respectively.

manbp commented 5 years ago

I have modified the dataset folder . Now it contains only two folders, img and cls, with Image files and Segmentation files respectively as shown in the screenshot https://gofile.io/?c=7ROT5T. And tried the following code:

parser.add_argument("--dataset_dir", default='C:/Users/hp/Desktop/VOCtrainval_11-May-2012/VOCdevkit/VOC2012', help="A directory containing img (Images) and cls (GT Segmentation) folder")

but I am getting the same error. Please help.

mohitzsh commented 5 years ago

I won't be able to offer more help than this without having access to debug code at your end.

I would suggest that you understand how the data loading works in the code and see what is going wrong. As I mentioned before, this is handled in the PascalVOC class located here- https://github.com/ms-sharma/Adversarial-Semisupervised-Semantic-Segmentation/blob/master/datasets/pascalvoc.py.

mohitzsh commented 5 years ago

I am closing this issue for now.