docstr: load the model config
  
  modelpath: inference model path
  
  use_gpu: use gpu or not
  
  use_mkldnn: use mkldnn or not
  
  combined: inference model format is combined or not
docstr_tok: ["load","the","model","config","modelpath",":","inference","model","path","use_gpu",":","use","gpu","or","not","use_mkldnn",":","use","mkldnn","or","not","combined",":","inference","model","format","is","combined","or","not"]
code: def load_config(self, modelpath, use_gpu, use_mkldnn, combined):
      """
      load the model config
  
      modelpath: inference model path
  
      use_gpu: use gpu or not
  
      use_mkldnn: use mkldnn or not
  
      combined: inference model format is combined 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.'
              )
              use_gpu = False
  
      # 加载模型参数
      if combined:
          model = os.path.join(modelpath, "__model__")
          params = os.path.join(modelpath, "__params__")
          config = Config(model, params)
      else:
          config = Config(modelpath)
  
      # 设置参数
      if use_gpu:
          config.enable_use_gpu(100, 0)
      else:
          config.disable_gpu()
          if use_mkldnn:
              config.enable_mkldnn()
  
      # 返回配置
      return config
  
file_path: PaddleHub/modules/image/depth_estimation/MiDaS_Small/inference.py
imports: import os
  import numpy
  from paddle.inference import create_predictor, Config
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, use_mkldnn, combined) and returns: config