docstr: load the model config
  modelpath: inference model path
  use_gpu: use gpu or not
  use_mkldnn: use mkldnn or not
docstr_tok: ["load","the","model","config","modelpath",":","inference","model","path","use_gpu",":","use","gpu","or","not","use_mkldnn",":","use","mkldnn","or","not"]
code: def load_config(
      self, modelpath, use_gpu, gpu_id, use_mkldnn, cpu_threads
  ):
      """
      load the model config
      modelpath: inference model path
      use_gpu: use gpu or not
      use_mkldnn: use mkldnn or not
      """
      # 对运行位置进行配置
      if use_gpu:
          try:
              int(os.environ.get("CUDA_VISIBLE_DEVICES"))
          except Exception:
              print(
                  """Error! Unable to use GPU. Please set the environment variables "CUDA_VISIBLE_DEVICES=GPU_id" to use GPU. Now switch to CPU to continue..."""
              )
              use_gpu = False
  
      if os.path.isdir(modelpath):
          if os.path.exists(os.path.join(modelpath, "__params__")):
              # __model__ + __params__
              model = os.path.join(modelpath, "__model__")
              params = os.path.join(modelpath, "__params__")
              config = Config(model, params)
          elif os.path.exists(os.path.join(modelpath, "params")):
              # model + params
              model = os.path.join(modelpath, "model")
              params = os.path.join(modelpath, "params")
              config = Config(model, params)
          elif os.path.exists(os.path.join(modelpath, "__model__")):
              # __model__ + others
              config = Config(modelpath)
          else:
              raise Exception(
                  "Error! Can't find the model in: %s. Please check your model path."
                  % os.path.abspath(modelpath)
              )
      elif os.path.exists(modelpath + ".pdmodel"):
          # *.pdmodel + *.pdiparams
          model = modelpath + ".pdmodel"
          params = modelpath + ".pdiparams"
          config = Config(model, params)
      elif isinstance(modelpath, Config):
          config = modelpath
      else:
          raise Exception(
              "Error! Can't find the model in: %s. Please check your model path."
              % os.path.abspath(modelpath)
          )
  
      # 设置参数
      if use_gpu:
          config.enable_use_gpu(100, gpu_id)
      else:
          config.disable_gpu()
          config.set_cpu_math_library_num_threads(cpu_threads)
          if use_mkldnn:
              config.enable_mkldnn()
  
      config.disable_glog_info()
  
      # 返回配置
      return config
  
file_path: PaddleHub/modules/image/Image_gan/style_transfer/animegan_v1_hayao_60/model.py
imports: import os
  import numpy
  from paddle.inference import Config
  from paddle.inference import create_predictor
label_desc: Use image node_id 4 for calling the InferenceModel obj's underlying member method code with example usage: obj.load_config(modelpath, use_gpu, gpu_id, use_mkldnn, cpu_threads) and returns: config