Ejemplo n.º 1
0
 def _get_basemodel(self, model_name):
     try:
         model = self.resnet_dict[model_name]
     except KeyError:
         raise InvalidBackboneError(
             "Invalid backbone architecture. Check the config file and pass one of: resnet18 or resnet50")
     else:
         return model
Ejemplo n.º 2
0
 def _get_basemodel(self, model_name):
     try:
         model = self.model_dict[model_name]
     except KeyError:
         raise InvalidBackboneError(
             "Invalid downstream architecture. Currently supported arch : resnet18 or resnet50"
         )
     else:
         return model
Ejemplo n.º 3
0
 def _get_basemodel(self, model_name):
     try:
         model = self.resnet_dict[model_name]
         if self.in_channels == 1:
             model.conv1 = nn.Conv2d(self.in_channels,
                                     64,
                                     kernel_size=7,
                                     stride=2,
                                     padding=3,
                                     bias=False)
     except KeyError:
         raise InvalidBackboneError(
             "Invalid backbone architecture. Check the config file and pass one of: resnet18 or resnet50"
         )
     else:
         return model