this is my model:
def __init__(self, features, num_classes=8, init_weights=True):
super(VGG, self).__init__()
self.features = features
self.roiNum = 6
self.roi_pool = _RoIPooling(5,5,1.0/32.0)
self.rois_classifiers = []
classifier = nn.Sequential(
nn.Linear(512 * 5 * 5, 512),
nn.ReLU(True),
nn.Dropout(),
nn.Linear(512, 512),
nn.ReLU(True),
nn.Dropout(),
nn.Linear(512, num_classes),
).cuda()
for i in range(self.roiNum):
self.rois_classifiers.append(copy.deepcopy(classifier))
if init_weights:
self._initialize_weights()
when i saved the model, it only saves self.feautures and self.roi_pool parameters. self.rois_classifiers parameters are not saved. Also when i print the model, again it just printed features and roi_pool layers, not rois_classifier layers. However, when i print model.rois_classifiers, everything is fine.
What is the problem here?