I code like it, but it said mobileNetV3 has no attribute ‘model’
And my code below

class MobileNetV3(MyNetwork):
def __init__(self, first_conv, blocks, final_expand_layer, feature_mix_layer, classifier):
    super(MobileNetV3, self).__init__()
    
    self.first_conv = first_conv
    self.blocks = nn.ModuleList(blocks)
    self.final_expand_layer = final_expand_layer
    self.feature_mix_layer = feature_mix_layer
    self.classifier = classifier
    self.quant = torch.quantization.QuantStub()
    self.dequant = torch.quantization.DeQuantStub()

def forward(self, x):
    x.contiguous(memory_format=torch.channels_last)
    x = self.quant(x)
    x = self.first_conv(x)
    for block in self.blocks:
        x = block(x)
    x = self.final_expand_layer(x)
    x = x.mean(3, keepdim=True).mean(2, keepdim=True)  # global average pooling
    x = self.feature_mix_layer(x)
    x = torch.squeeze(x)
    x = self.classifier(x)
    x = self.dequant(x)
    return x

@property
def module_str(self):
    _str = self.first_conv.module_str + '\n'
    for block in self.blocks:
        _str += block.module_str + '\n'
    _str += self.final_expand_layer.module_str + '\n'
    _str += self.feature_mix_layer.module_str + '\n'
    _str += self.classifier.module_str
    return _str

@property
def config(self):
    return {
        'name': MobileNetV3.__name__,
        'bn': self.get_bn_param(),
        'first_conv': self.first_conv.config,
        'blocks': [
            block.config for block in self.blocks
        ],
        'final_expand_layer': self.final_expand_layer.config,
        'feature_mix_layer': self.feature_mix_layer.config,
        'classifier': self.classifier.config,
    }

@staticmethod
def build_from_config(config):
    first_conv = set_layer_from_config(config['first_conv'])
    final_expand_layer = set_layer_from_config(config['final_expand_layer'])
    feature_mix_layer = set_layer_from_config(config['feature_mix_layer'])
    classifier = set_layer_from_config(config['classifier'])

    blocks = []
    for block_config in config['blocks']:
        blocks.append(MobileInvertedResidualBlock.build_from_config(block_config))

    net = MobileNetV3(first_conv, blocks, final_expand_layer, feature_mix_layer, classifier)
    if 'bn' in config:
        net.set_bn_param(**config['bn'])
    else:
        net.set_bn_param(momentum=0.1, eps=1e-3)

    return net

def zero_last_gamma(self):
    for m in self.modules():
        if isinstance(m, MobileInvertedResidualBlock):
            if isinstance(m.mobile_inverted_conv, MBInvertedConvLayer) and isinstance(m.shortcut, IdentityLayer):
                m.mobile_inverted_conv.point_linear.bn.weight.data.zero_()


But when I try to use

torch.quantization.fuse_modules(model, [[‘conv’, ‘bn’, ‘relu’]], inplace=True)
The error:
‘MobileNetV3’ object has no attribute ‘conv’