Yang-Bob / PMMs

Prototype Mixture Models for Few-shot Semantic Segmentation
163 stars 27 forks source link

multi-GPUs training #6

Open qiulesun opened 3 years ago

Yang-Bob commented 3 years ago

Hi, our experiments are divided into 4 groups and we use 4 GPU to run the code independently. It doesn't support multi-GPU to train 1 group experiment. If you need it, you can refer to some documents about pytorch multi-gpu training. For example, you may add model = nn.DataParallel(model) into the code. In my impression, it should not be particularly complicated.

qiulesun commented 3 years ago

Could you offer the motivation of introducing the P-Conv ?

Yang-Bob commented 3 years ago

P-Conv treats PMMs as classifiers to activate spatial semantic information while P-Match treats PMMs as representations to activate channel-wised information. It is a duplex strategy to activate feature maps.

qiulesun commented 3 years ago

@Yang-Bob

  1. I notice that the settings of COCO 2017 are commented (such as https://github.com/Yang-Bob/PMMs/blob/master/data/LoadDataSeg.py#L27). Does your repo support training of PMM using COCO 2017 ?

  2. For runing test_frame.py, when k_shot=5, batchsize=1, the query_img and support_img are 5-dimensional input rather than 4-dimensional, this line (https://github.com/Yang-Bob/PMMs/blob/master/test_frame.py#L75) reports the following error: RuntimeError: Expected 4-dimensional input for 4-dimensional weight 64 3 7 7, but got 5-dimensional input of size [1, 5, 3, 481, 481] instead.

  3. Are the data_list/train/splitX_train.txt and data_list/val/splitX_val.txt created by yourself ?

Yang-Bob commented 3 years ago

Thanks for reminding me of some missing problem in our repository.

  1. Our code support training PMMs using COCO 2017 and I have fixed it. I commented it for I didn't push the relative code before.
  2. You can use python test_5shot.py within the 5 shot setting. The code needs another forward function.
  3. The .txt file is generated by CANet. For a fair comparison, we use this file to get the image.