GithubHelp home page GithubHelp logo

adityaarun1 / detectron.pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from roytseng-tw/detectron.pytorch

65.0 65.0 18.0 13.46 MB

A PyTorch implementation of Detectron. Both training from scratch and inferring directly from pretrained Detectron weights are available. Supports PyTorch 1.1+ and TorchVision 0.3.0+. No compilation necessary.

License: MIT License

Python 99.66% MATLAB 0.33% Shell 0.01%

detectron.pytorch's People

Contributors

adityaarun1 avatar jiasenlu avatar jwyang avatar roytseng-tw avatar vfdev-5 avatar yuliang-zou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

detectron.pytorch's Issues

COCO Performance

Hi, thanks for the great work! I wonder if you have replicated the performance on COCO under the new version.

Evaluation scripts for Custom Dataset & VOC

Hey!

I have finetuned a network on VOC 2007, which was initially trained on COCO Dataset.

I am now trying to evaluate the training on the validation set. When I run the command,
python tools/test_net.py --dataset voc2007 --cfg configs/baselines/e2e_mask_rcnn_R-50-FPN_1x.yaml --load_ckpt {path/to/your/checkpoint},

I get this:
INFO task_evaluation.py: 61: Evaluating bounding boxes is done!

INFO task_evaluation.py: 104: Evaluating segmentations
Traceback (most recent call last):

File "tools/test_net.py", line 125, in
check_expected_results=True)

File "/home/deep/data/asif/Detectron/Detectron.pytorch/lib/core/test_engine.py", line 128, in run_inference
all_results = result_getter()

File "/home/deep/data/asif/Detectron/Detectron.pytorch/lib/core/test_engine.py", line 108, in result_getter
multi_gpu=multi_gpu_testing

File "/home/deep/data/asif/Detectron/Detectron.pytorch/lib/core/test_engine.py", line 163, in test_net_on_dataset
dataset, all_boxes, all_segms, all_keyps, output_dir

File "/home/deep/data/asif/Detectron/Detectron.pytorch/lib/datasets/task_evaluation.py", line 63, in evaluate_all
results = evaluate_masks(dataset, all_boxes, all_segms, output_dir)

File "/home/deep/data/asif/Detectron/Detectron.pytorch/lib/datasets/task_evaluation.py", line 128, in evaluate_masks
'No evaluator for dataset: {}'.format(dataset.name)

NotImplementedError: No evaluator for dataset: voc_2007_test

This appears from the task_evaluation file where no implementation for voc evaluation in masks. Is there a work around?

Since, voc is already in json format I guessed it is still possible to evaluate segmentations in the task_evaluation script! How to do this?

Infer test images on a custom dataset

Hi!
I am trying to use voc dataset to infer test images. It works fine with the coco dataset! I am exploring the code and its abilities as I ultimately want to use a custom dataset and classes! So, I was trying to visualize the training performance of VOC2007 on the infer_simple.py. But its not possible as the infer_simple.py only accepts coco or keypoints coco as the acceptable dataset. Am I doing something wrong here?

ImportError using Pytorch 1.1.0

Import Error using Pytorch 1.1.0

I encountered this error during a dataset conversion to COCO json format

----> 6 from lib.utils.boxes import xyxy_to_xywh
.
.
.
/content/Detectron.pytorch/lib/nn/parallel/scatter_gather.py in <module>()
      6 from ._functions import Scatter, Gather
      7 from torch._six import string_classes, int_classes
----> 8 from torch.utils.data.dataloader import numpy_type_map
      9 
     10 

ImportError: cannot import name 'numpy_type_map'

It seems that numpy_type_map has been moved to torch/utils/data/_utils/collate.py in pytorch 1.1.0

Maybe numpy_type_map should be redefined entirely instead of being imported.

EDIT: Same error encountered when executing

python tools/download_imagenet_weights.py

Freeze All layers except Output layers

Hi,

I am finetuning a COCO pretrained model with VOC dataset. I am using the config file : e2e_mask_rcnn_R-50-FPN_1x.yaml

I found a key to freeze the backbone of model with TRAIN.FREEZE_CONV_BODY: True
But this only freezes the Convolutional layers. How do I freeze the Fast RCNN and MRCNN layers so I can update the output layers alone by fine tuning ?

torch 1.0.1 not matched torchvision 0.3.0

I installed torchvision 0.3.0 first, and it told me:

ERROR: torchvision 0.3.0 has requirement torch>=1.1.0, but you'll have torch 1.0.1 which is incompatible.

when I pip install torch-1.0.1-cp35-cp35m-manylinux1_x86_64.whl. So what are the matched versions?

Finetuning with VOC2007

Hi!

I trained from scratch completely a network with COCO2017 dataset with:

python tools/train_net_step.py --dataset coco2017 --cfg configs/baselines/e2e_mask_rcnn_R-50-FPN_1x.yaml --use_tfboard --bs=2

I now used the checkpoint (pth file) created from the train from scratch to finetune with VOC2007 dataset.

As expected I ran into trouble because the number of classes in VOC (21) and COCO (81) are different. I understand its possible to finetune as there are steps given to finetune custom dataset with different number of classes. I would like to know how to do this?

The command i used:
python tools/train_net_step.py --dataset voc2007 --cfg configs/baselines/e2e_mask_rcnn_R-50-FPN_1x.yaml --load_ckpt=/home/deep/data/asif/Detectron/Detectron.pytorch/Outputs/e2e_mask_rcnn_R-50-FPN_1x/Mar14-14-59-32_deeppc_step/ckpt/model_step719999.pth --use_tfboard --bs=2

The errors I got:
Traceback (most recent call last):
File "tools/train_net_step.py", line 471, in
main()
File "tools/train_net_step.py", line 331, in main
net_utils.load_ckpt(maskRCNN, checkpoint['model'])
File "/home/deep/data/asif/Detectron/Detectron.pytorch/lib/utils/net.py", line 163, in load_ckpt
model.load_state_dict(state_dict, strict=False)
File "/home/deep/anaconda3/envs/detectron/lib/python3.7/site-packages/torch/nn/modules/module.py", line 769, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for Generalized_RCNN:
size mismatch for Box_Outs.cls_score.weight: copying a param with shape torch.Size([81, 1024]) from checkpoint, the shape in current model is torch.Size([21, 1024]).
size mismatch for Box_Outs.cls_score.bias: copying a param with shape torch.Size([81]) from checkpoint, the shape in current model is torch.Size([21]).
size mismatch for Box_Outs.bbox_pred.weight: copying a param with shape torch.Size([324, 1024]) from checkpoint, the shape in current model is torch.Size([84, 1024]).
size mismatch for Box_Outs.bbox_pred.bias: copying a param with shape torch.Size([324]) from checkpoint, the shape in current model is torch.Size([84]).
size mismatch for Mask_Outs.classify.weight: copying a param with shape torch.Size([81, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([21, 256, 1, 1]).
size mismatch for Mask_Outs.classify.bias: copying a param with shape torch.Size([81]) from checkpoint, the shape in current model is torch.Size([21]).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.