I wish to create a model which uses a resnet as part of the architecture
It will eventually have other layers, but I’ve put together a quick prototype:
class CombinedModel(torch.nn.Module):
def __init__(self):
super(CombinedModel, self).__init__()
self.resnet = torch.hub.load('pytorch/vision:v0.10.0', 'resnet101', pretrained=True)
def forward(self, x):
x = self.resnet(x)
return x
This seems to learn fine with my (very standard) training code. Are there any things I need to be aware of though? Do I need to forward, for example, .eval and .train calls to the sub-model?