question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No results on test dataset

See original GitHub issue
  • Operating system: ubuntu 16.04
  • CUDA version: 9.0
  • cuDNN version: 7.0.5
  • NVIDIA driver version: 396.44
  • GPU models (for all devices if they are not all the same): 950M 4Gb
  • python --version output: 2.7.12

I trained a Faster R-CNN with ResNet50 model on my custom train dataset, and everything seems ok. But when I test it on my custom test dataset (test of train_net.py), I get this results:

INFO test_engine.py: 320: Wrote detections to: home/juan/detectron/test/tools_test/generalized_rcnn/detections.pkl INFO test_engine.py: 162: Total inference time: 101.063s INFO task_evaluation.py: 76: Evaluating detections INFO json_dataset_evaluator.py: 162: Writing bbox results json to: home/juan/detectron/test/tools_test/generalized_rcnn/bbox_tools_test_results.json INFO task_evaluation.py: 62: Evaluating bounding boxes is done! INFO task_evaluation.py: 181: copypaste: Dataset: tools_test INFO task_evaluation.py: 183: copypaste: Task: box INFO task_evaluation.py: 186: copypaste: AP,AP50,AP75,APs,APm,APl INFO task_evaluation.py: 187: copypaste: -1.0000,-1.0000,-1.0000,-1.0000,-1.0000,-1.0000

But If I run infer_simple.py with the test images, I can see that model is relatively good:

If I test it on my train dataset (I know that this isn’t correct), I get this:

INFO test_engine.py: 320: Wrote detections to: /home/juan/detectron/test/tools_train/generalized_rcnn/detections.pkl INFO test_engine.py: 162: Total inference time: 180.051s INFO task_evaluation.py: 76: Evaluating detections INFO json_dataset_evaluator.py: 162: Writing bbox results json to: /home/juan/detectron/test/tools_train/generalized_rcnn/bbox_tools_train_results.json Loading and preparing results… DONE (t=0.01s) creating index… index created! Running per image evaluation… Evaluate annotation type bbox DONE (t=0.38s). Accumulating evaluation results… DONE (t=0.05s). INFO json_dataset_evaluator.py: 222: ~~~~ Mean and per-category AP @ IoU=[0.50,0.95] ~~~~ INFO json_dataset_evaluator.py: 223: 93.0 INFO json_dataset_evaluator.py: 231: 95.5 INFO json_dataset_evaluator.py: 231: 91.5 INFO json_dataset_evaluator.py: 231: 91.9 INFO json_dataset_evaluator.py: 232: ~~~~ Summary metrics ~~~~ Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.930 Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.997 Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.993 Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = -1.000 Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.908 Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.938 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.449 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.949 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.951 Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = -1.000 Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.927 Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.958 INFO json_dataset_evaluator.py: 199: Wrote json eval results to: ./test/tools_train/generalized_rcnn/detection_results.pkl INFO task_evaluation.py: 62: Evaluating bounding boxes is done! INFO task_evaluation.py: 181: copypaste: Dataset: tools_train INFO task_evaluation.py: 183: copypaste: Task: box INFO task_evaluation.py: 186: copypaste: AP,AP50,AP75,APs,APm,APl INFO task_evaluation.py: 187: copypaste: 0.9298,0.9967,0.9932,-1.0000,0.9079,0.9380

I don’t know why if model can detect object on test dataset, I don’t get summary metrics… and only I get -1.0000 in all metrics.

My original dataset’s labels was in xml, and I convert it to json with this file, but the generated json to test and train are slightly differents, because this script assign a id number to a name in order in which script find it in dataset. I testes withouth changes, change the json with find+replace to leave category_id same in both json and finally, I changed script, I replaced line 22, and I assign category_item_id to harcoded name:

if name == "plier":
    category_item_id = 1
elif name == "screwdriver":
    category_item_id = 2
elif name == "wrench":
    category_item_id = 3

But in all cases, I always get same results if I test on my test dataset.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
gadcamcommented, Aug 15, 2018

Looks like a duplicate of #293. https://github.com/facebookresearch/Detectron/issues/293#issuecomment-397962141 could be the solution

(#588 could be relevant too)

0reactions
juanluisdbcommented, Jul 26, 2019

The folder can’t contain “test”

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Model Performance Mismatch Problem (and what to do ...
What To Do If Model Test Results Are Worse than Training. The procedure when evaluating machine learning models is to fit and evaluate...
Read more >
Good results when training and cross-validating a model, but ...
Your model is overfitted to training data. So you have good results during learning phase and poor results on validation data. – 404pio....
Read more >
How do you use the 'test' dataset after cross-validation?
How do you use the 'test' dataset after cross-validation? · 1. You evaluate your best model on that test set and report the...
Read more >
Test results not showing in MAP Growth reports
Test results are not showing in MAP Growth reports. Explanation. There are several reasons why a score might be missing from reports.
Read more >
High train score, very low test score | Data Science ... - Kaggle
Look for overfitting. Also, are you sure you separated your labels (categories/classes) from the data in your dataset so they are not used...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found