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.

Error using sequential on faster-rcnn to get regional proposal network object features

See original GitHub issue

I’m trying to use pretrained FasterRCNN network provided in torchvision. model=torchvision.models.detection.fasterrcnn_resnet50_fpn(pretrained=True) model.eval() model([image_tensor]) working perfectly fine but when I use sequential to stop at intermediate layers like this model2=nn.Sequential(*list(model.children())[:-2]) to use until RPN network I’m getting error when passing a image as show below TypeError: conv2d(): argument 'input' (position 1) must be Tensor, not tuple

So then, I tried to inherit nn.module and implement based on Generalized RCNN and faster-rcnn.py as shown here but instead of Kx2048 features I’m getting 862x4. feature vector.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:23 (9 by maintainers)

github_iconTop GitHub Comments

8reactions
ananthpncommented, Feb 21, 2020

Thanks much @fmassa your solution works so well for me. I used this in my application and am posting here your code wrapped as a function for any one who may have a similar requirement:

Screenshot from 2020-02-21 12-57-14

1reaction
fmassacommented, Jun 6, 2019

No worries! Let us know if you have any other comment / feedback

Read more comments on GitHub >

github_iconTop Results From Across the Web

An Enhanced Region Proposal Network for object detection ...
Inspired by RPN of Faster R-CNN, we propose a novel proposal generation method called Enhanced Region Proposal Network (ERPN). Four improvements ...
Read more >
Faster R-CNN - - NeuralCeption -
The first module extracts features and identifies regions which could contain objects. This module consists of the Region Proposal Network [22].
Read more >
Faster R-CNN: Towards Real-Time Object ... - YouTube
Faster R-CNN : Towards Real-Time Object Detection with Region Proposal Networks. 2.4K views 2 years ago. nPlan. nPlan. 930 subscribers.
Read more >
Revisiting Faster R-CNN: A Deeper Look at Region Proposal ...
In Faster R-CNN, RPN is built on top of high-level convolutional feature ... To summarise, we propose an object detection network with region...
Read more >
Faster R-CNN with Region Proposal Refinement - CS231n
Region -based Convolutional Neural Network, or R-CNN, was proposed not long after the emergence of. CNN and it greatly improved the detection performance...
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