Facing problem detection using pre-trained Faster R-CNN

model = models.detection.fasterrcnn_resnet50_fpn(pretrained=True)
AttributeError: module ‘torchvision.models’ has no attribute ‘detection’

Tried with Pytorch 0.4.1 and 1.1.0 as well.
Thanks in advance.

Did you try this after upgrading torch to 1.2.0:

pip install --upgrade torchvision

Related issue:

1 Like

This is because you seem to using the version before torchvision 0.3. Detection modules were added in 0.3.

Thanks.

pip install --upgrade torchvision

Resolved it.

Thanks for the response.