Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

perform training on negative samples (images with no annotation) #869

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gcheron
Copy link

@gcheron gcheron commented Apr 15, 2019

@ir413 , @JiYuanFeng , this allows the use of negative samples in training when setting TRAIN.INCLUDE_BKG_IMAGES = True (related to #697 )

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@gcheron gcheron changed the title allow to perform training on negative samples (images with no annotation) perform training on negative samples (images with no annotation) Apr 15, 2019
@gcheron gcheron marked this pull request as ready for review April 15, 2019 14:58
@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@pkhigh
Copy link

pkhigh commented Apr 29, 2019

@gcheron I have tried to train a RETINANET model with your pr_negative_samples branch.
But I get the following error while loading the data :

[I net_dag_utils.cc:102] Operator graph pruning prior to chain compute took: 0.000376701 secs
INFO train.py: 180: Outputs saved to: /home/roadzen/ParasWork/MobileData/v4/RETINA_MODELS/train/coco_2014_train/retinanet
INFO loader.py: 230: Pre-filling mini-batch queue...
INFO loader.py: 235: [0/64]
Traceback (most recent call last):
File "/home/roadzen/ParasWork/Detectron/detectron/utils/coordinator.py", line 50, in stop_on_exception
yield
File "/home/roadzen/ParasWork/Detectron/detectron/roi_data/loader.py", line 101, in minibatch_loader_thread
blobs = self.get_next_minibatch()
File "/home/roadzen/ParasWork/Detectron/detectron/roi_data/loader.py", line 134, in get_next_minibatch
blobs, valid = get_minibatch(minibatch_db)
File "/home/roadzen/ParasWork/Detectron/detectron/roi_data/minibatch.py", line 81, in get_minibatch
blobs, im_scales, roidb, im_width, im_height
File "/home/roadzen/ParasWork/Detectron/detectron/roi_data/retinanet.py", line 109, in add_retinanet_blobs
'Empty ground truth empty for image is not allowed. Please check.'
AssertionError: Empty ground truth empty for image is not allowed. Please check.
INFO loader.py: 113: Stopping mini-batch loading thread
INFO loader.py: 113: Stopping mini-batch loading thread
INFO loader.py: 113: Stopping mini-batch loading thread
INFO loader.py: 113: Stopping mini-batch loading thread
CRITICAL train.py: 98: roi_data_loader failed
Traceback (most recent call last):
File "tools/train_net.py", line 132, in
main()
File "tools/train_net.py", line 114, in main
checkpoints = detectron.utils.train.train_model()
File "/home/roadzen/ParasWork/Detectron/detectron/utils/train.py", line 64, in train_model
handle_critical_error(model, 'roi_data_loader failed')
File "/home/roadzen/ParasWork/Detectron/detectron/utils/train.py", line 100, in handle_critical_error
raise Exception(msg)
Exception: roi_data_loader failed

@pkhigh
Copy link

pkhigh commented Apr 29, 2019

It looks like you have done changes for RPN.py i.e. models which use RPNs will only be able to use this feature. There are on changes in "roi_data/retinanet.py" therefore this error occurs.
Can you suggest the changes to be made in roi_data/retinanet.py so that I can train it with background images?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants