def _load_state_dict(self, path):
    checkpoint = torch.load(path, map_location=torch.device('cpu'))
    extra_keys = set(checkpoint.keys()).difference(set(self.model.state_dict().keys()))
    if extra_keys:
        self.logger.error('%d extra keys in checkpoint! Make sure the genotype match', len(extra_keys))
    missing_keys = {key for key in set(self.model.state_dict().keys()).difference(checkpoint.keys()) if ('auxiliary' not in key)}
    if missing_keys:
        self.logger.error("{} missing keys will not be loaded! Check your genotype, This should be due to you're using the state dict dumped by `awnas eval-arch --save-state-dict` in an old version, and your genotype actually skip some cells, which might means, many parameters of your sub-network is not actually active, and this genotype might not be so effective.".format(len(missing_keys)))
        self.logger.error(str(missing_keys))
    self.logger.info(self.model.load_state_dict(checkpoint, strict=False))
def _load_state_dict(self, path):
    checkpoint = torch.load(path, map_location=torch.device('cpu'))
    extra_keys = set(checkpoint.keys()).difference(set(self.model.state_dict().keys()))
    if extra_keys:
        self.logger.error('%d extra keys in checkpoint! Make sure the genotype match', len(extra_keys))
    missing_keys = {key for key in set(self.model.state_dict().keys()).difference(checkpoint.keys()) if ('auxiliary' not in key)}
    if missing_keys:
        self.logger.error("{} missing keys will not be loaded! Check your genotype, This should be due to you're using the state dict dumped by `awnas eval-arch --save-state-dict` in an old version, and your genotype actually skip some cells, which might means, many parameters of your sub-network is not actually active, and this genotype might not be so effective.".format(len(missing_keys)))
        self.logger.error(str(missing_keys))
    self.logger.info(self.model.load_state_dict(checkpoint, strict=False))