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.

test `test_fasterrcnn_resnet50_fpn` is failing

See original GitHub issue

🐛 Bug

Error text:

___________________ ModelTester.test_fasterrcnn_resnet50_fpn ___________________

self = <test_models.ModelTester testMethod=test_fasterrcnn_resnet50_fpn>
model_name = 'fasterrcnn_resnet50_fpn'

    def do_test(self, model_name=model_name):
>       self._test_detection_model(model_name)

test/test_models.py:340: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
test/test_models.py:144: in _test_detection_model
    scripted_model = torch.jit.script(model)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/__init__.py:1355: in script
    return torch.jit._recursive.create_script_module(obj, torch.jit._recursive.infer_methods_to_compile)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:310: in create_script_module
    concrete_type = concrete_type_store.get_or_create_concrete_type(nn_module)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:269: in get_or_create_concrete_type
    concrete_type_builder = infer_concrete_type_builder(nn_module)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:138: in infer_concrete_type_builder
    sub_concrete_type = concrete_type_store.get_or_create_concrete_type(item)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:269: in get_or_create_concrete_type
    concrete_type_builder = infer_concrete_type_builder(nn_module)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:231: in infer_concrete_type_builder
    attr_type = infer_type(name, value)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:99: in infer_type
    attr_type = torch.jit.annotations.ann_to_type(class_annotations[name], _jit_internal.fake_range())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

ann = <class 'torchvision.models.detection._utils.Matcher'>
loc = <torch._C._jit_tree_views.SourceRange object at 0x7feb2a671458>

    def ann_to_type(ann, loc):
        the_type = try_ann_to_type(ann, loc)
        if the_type is not None:
            return the_type
>       raise ValueError("Unknown type annotation: '{}'".format(ann))
E       ValueError: Unknown type annotation: '<class 'torchvision.models.detection._utils.Matcher'>'

../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/annotations.py:309: ValueError
__________________ ModelTester.test_keypointrcnn_resnet50_fpn __________________

self = <test_models.ModelTester testMethod=test_keypointrcnn_resnet50_fpn>
model_name = 'keypointrcnn_resnet50_fpn'

    def do_test(self, model_name=model_name):
>       self._test_detection_model(model_name)

test/test_models.py:340: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
test/test_models.py:144: in _test_detection_model
    scripted_model = torch.jit.script(model)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/__init__.py:1355: in script
    return torch.jit._recursive.create_script_module(obj, torch.jit._recursive.infer_methods_to_compile)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:310: in create_script_module
    concrete_type = concrete_type_store.get_or_create_concrete_type(nn_module)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:269: in get_or_create_concrete_type
    concrete_type_builder = infer_concrete_type_builder(nn_module)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:138: in infer_concrete_type_builder
    sub_concrete_type = concrete_type_store.get_or_create_concrete_type(item)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:269: in get_or_create_concrete_type
    concrete_type_builder = infer_concrete_type_builder(nn_module)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:231: in infer_concrete_type_builder
    attr_type = infer_type(name, value)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:99: in infer_type
    attr_type = torch.jit.annotations.ann_to_type(class_annotations[name], _jit_internal.fake_range())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

ann = <class 'torchvision.models.detection._utils.Matcher'>
loc = <torch._C._jit_tree_views.SourceRange object at 0x7feb2a71c848>

    def ann_to_type(ann, loc):
        the_type = try_ann_to_type(ann, loc)
        if the_type is not None:
            return the_type
>       raise ValueError("Unknown type annotation: '{}'".format(ann))
E       ValueError: Unknown type annotation: '<class 'torchvision.models.detection._utils.Matcher'>'

../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/annotations.py:309: ValueError
____________________ ModelTester.test_maskrcnn_resnet50_fpn ____________________

self = <test_models.ModelTester testMethod=test_maskrcnn_resnet50_fpn>
model_name = 'maskrcnn_resnet50_fpn'

    def do_test(self, model_name=model_name):
>       self._test_detection_model(model_name)

test/test_models.py:340: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
test/test_models.py:144: in _test_detection_model
    scripted_model = torch.jit.script(model)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/__init__.py:1355: in script
    return torch.jit._recursive.create_script_module(obj, torch.jit._recursive.infer_methods_to_compile)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:310: in create_script_module
    concrete_type = concrete_type_store.get_or_create_concrete_type(nn_module)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:269: in get_or_create_concrete_type
    concrete_type_builder = infer_concrete_type_builder(nn_module)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:138: in infer_concrete_type_builder
    sub_concrete_type = concrete_type_store.get_or_create_concrete_type(item)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:269: in get_or_create_concrete_type
    concrete_type_builder = infer_concrete_type_builder(nn_module)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:231: in infer_concrete_type_builder
    attr_type = infer_type(name, value)
../_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh/lib/python3.6/site-packages/torch/jit/_recursive.py:99: in infer_type
    attr_type = torch.jit.annotations.ann_to_type(class_annotations[name], _jit_internal.fake_range())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

ann = <class 'torchvision.models.detection._utils.Matcher'>
loc = <torch._C._jit_tree_views.SourceRange object at 0x7feb2e36c5e0>

    def ann_to_type(ann, loc):
        the_type = try_ann_to_type(ann, loc)
        if the_type is not None:
            return the_type
>       raise ValueError("Unknown type annotation: '{}'".format(ann))
E       ValueError: Unknown type annotation: '<class 'torchvision.models.detection._utils.Matcher'>'

To Reproduce

See binary jobs on CircleCI

Expected behavior

Tests pass.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
peterjc123commented, Jan 7, 2021

@datumbox It seems that you reopened it.

1reaction
fmassacommented, Jun 15, 2020

This has started failing a couple of days ago, and is probably due to an issue on upstream PyTorch.

cc @eellison

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problems training Faster-RCNN from pretrained backbone
I tried to train over 200 epochs, the loss keep decreasing (down to 0.01) but the mAP over Test and validation decreases over...
Read more >
Road Pothole Detection with PyTorch Faster RCNN ResNet50
In this blog post, we carry out road pothole detection using Faster RCNN and deep learning with the PyTorch framework.
Read more >
Drop in Accuracy after using SSD ResNet50 FPN COCO in ...
I used Tensorflow Object Detection API and finetune the model using my own dataset. After converting the model into IR graph and quantizing...
Read more >
Review: RetinaNet — Focal Loss (Object Detection)
One-Stage Detector, With Focal Loss and RetinaNet Using ResNet+FPN, Surpass the Accuracy of Two-Stage Detectors, Faster R-CNN.
Read more >
A Faster R-CNN-Based Model for the Identification of Weed ...
and >1000 images for testing demonstrate a recognition accuracy of >95%. ... Keywords: weed identification; Faster-R-CNN; FPN; ResNeXt.
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