Faster-rcnn.pytorch: the implementation of faster_rcnn.py

Created on 15 Aug 2018  路  1Comment  路  Source: jwyang/faster-rcnn.pytorch

faster_rcnn
RCNN_base() in faster_rcnn.py is not defined and the class "_faster_RCNN" is inherited from nn.Module. However, I found the definition of RCNN_base() in the class "Resnet", it's inhertited from the class "_faster_RCNN".
Thus, why does it work? Can super class use the method of subclass and it didn't declare in super class?

Most helpful comment

Hey, because _fasterRCNN is only a parent class. VGG and Resnet both extends the class.
So we can think "RCNN_base()" as a abstract method, you can't invoke this directly. (will prompt object has no attribute 'RCNN_base")
But you can use the method in _fasterRCNN's child class(VGG, Resnet).

>All comments

Hey, because _fasterRCNN is only a parent class. VGG and Resnet both extends the class.
So we can think "RCNN_base()" as a abstract method, you can't invoke this directly. (will prompt object has no attribute 'RCNN_base")
But you can use the method in _fasterRCNN's child class(VGG, Resnet).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GPaolo picture GPaolo  路  5Comments

ZhangJiajun1995 picture ZhangJiajun1995  路  5Comments

Codermay picture Codermay  路  5Comments

CJMenart picture CJMenart  路  4Comments

MathewXiren picture MathewXiren  路  5Comments