facebookresearch / detectron2

Detectron2 is a platform for object detection, segmentation and other visual recognition tasks.
https://detectron2.readthedocs.io/en/latest/
Apache License 2.0
30.12k stars 7.42k forks source link

Creating your own custom pretraining weights .pkl for Aerial Imagery with Detectron2 #5189

Open Prayag22 opened 9 months ago

Prayag22 commented 9 months ago

Hello all , As per available pretrained nets which were trained on msra dataset or coco dataset and we have various versions of resnet50 ,101 and 152 . I was planning go ahead with resnet101 as we train it or fine tune it using existing .pkl , i want to create my own .pkl for further training to simplify like create my massive aerial imagery dataset and train it on top of coco dataset so it would have learned features of earlier and now new aerial features than use it for further training of which we create .pth file . I tried convert .pth file to .pkl using script convert-torchvision-to-d2.py available in d2 tools folder however it could not be converted so i changed line newmodel[k] = obj.pop(old_k).detach().numpy() to newmodel[k] = obj.pop(old_k) it got converted however gave error when used for training . Please help me out thank you !