yanxp / MetaR-CNN

Meta R-CNN : Towards General Solver for Instance-level Low-shot Learning
https://yanxp.github.io/metarcnn.html
177 stars 23 forks source link

How do I train metaracnn on my own dataset? #14

Open duynn912 opened 4 years ago

duynn912 commented 4 years ago

I want to train metarcnn on my own dataset followwing PASCAL VOC format. My dataset has 200 classes so what do I have to finetune to train. Would you please help me and show me how much memory you use to train on COCO. My GPU have 12G but it is always out of memory, though I attempt to change bs and ws. Following your code in the first phase you use 200 shots to train so if I drop this parameter to smaller, is it fine ?

yanxp commented 4 years ago

hello, when training coco you can only sample the k-shots containing the classes of input X like our training phase figure3.

duynn912 commented 4 years ago

Thank you for your respond! But I think you misunderstood me. My problem here is how I can train my setting dataset following the format of PASCAL VOC. PASCAL has 20 classes and I finetune it to 200 classes to train. However, I have a problem related to out of memory although I drop ws to 0 or 1 and batchsize to 4 or 8. The number of images is similar to PASCAL formed from trainval 2007 and 2012. My GPU has 12 GB.

zb1439 commented 4 years ago

So are you training COCO with a different setting (referred as Meta-Optimization Process in the paper) from training VOC, i.e., train VOC with 20 ways support set simultaneously while training COCO with categories included in query image only? In addition, is this difference applied on your evaluation of COCO as well, i.e., using support set including query image categories only instead of a support set include all 80 categories at the same time?

duynn912 commented 4 years ago

Hi @zb1439,

I did not try to train on COCO. I just tried on PASCAL and my setting following PASCAL but I have had a memory problem. If it is successful, I will try it on COCO

zb1439 commented 4 years ago

Hi @duynn912 , we did successfully finished modification for parallel training and you can refer to issue #13 to have a glance of some major changes to adapt to multiple GPUs. Basically just change all the tensors to variable types and add additional batch dimension then tile the dimension #GPU times. Of course, some other easy fix after you change the two major implementation. But I am not sure if you can train 200 ways simultaneously just by utilizing GPUs (according to our experiment, batch per gpu = 1 was the max we could do for 80 ways. (We are using 12GB gpus as well)

We might fork this repo and add our modification later if @yanxp agrees with it.

duynn912 commented 4 years ago

Hi @zb1439 , Thank you so much for your implementation and recommendation. I think I should try it now.

yanxp commented 4 years ago

@zb1439 Welcome to pull requests, Thanks

EasitMickly commented 4 years ago

@yanxp I also want to train metarcnn on my own dataset followwing PASCAL VOC format. My dataset has 4 classes, but i don't know how to prepare the split datasets. I want to put the 3 class label in train_first_split.txt file, but i don't know how to prepare the few shot class dataset. Can you give me some help. Thank you very much.

cxcjcj commented 4 years ago

@EasitMickly Hello, did you solve this problem? I also want to train metarcnn on my own dataset followwing PASCAL VOC format. My dataset has 5 classes, but i don't know how to prepare split datasets. I want to put the 2 class label in train_first_split.txt file,but i don't know how to prepare the few shot class dataset. Can you give me some help. Thank you very much.