code: def upgrade_config(config, loaded_version):
      """Upgrade outdated configurations
  
      Parameters
      ----------
      config
          The configuration
      loaded_version
          The version of the config that has been loaded
  
      Returns
      -------
      config
          The upgraded configuration
      """
      # backward compatibility for variable image size.
      if version.parse(loaded_version) <= version.parse("0.6.2"):
          logger.info(
              f"Start to upgrade the previous configuration trained by AutoMM version={loaded_version}."
          )
          if OmegaConf.select(config, "model.timm_image") is not None:
              logger.warning(
                  "Loading a model that has been trained via AutoGluon Multimodal<=0.6.2. "
                  "Setting config.model.timm_image.image_size = None."
              )
              config.model.timm_image.image_size = None
      return config
  
imports: import copy
  import logging
  import os
  import re
  import warnings
  from typing import Callable, Dict, List, Optional, Tuple, Union
  from omegaconf import DictConfig, OmegaConf
  from packaging import version
  from torch import nn
  from ..constants import AUTOMM, DATA, FT_TRANSFORMER, FUSION_TRANSFORMER, HF_MODELS, MODEL, REGRESSION, VALID_CONFIG_KEYS
  from ..presets import get_automm_presets, get_basic_automm_config
  from .data import get_detected_data_types
label_desc: Use image node_id 9 for calling a global function with example usage: upgrade_config(config, loaded_version) and returns: config