code: def check_gpu(use_gpu):
      """
      Log error and exit when set use_gpu=true in paddlepaddle
      cpu version.
      """
      err = (
          "Config use_gpu cannot be set as true while you are "
          "using paddlepaddle cpu version ! \nPlease try: \n"
          "\t1. Install paddlepaddle-gpu to run model on GPU \n"
          "\t2. Set use_gpu as false in config file to run "
          "model on CPU"
      )
  
      try:
          if use_gpu and not paddle.is_compiled_with_cuda():
              logger.error(err)
              sys.exit(1)
      except Exception as e:
          pass
  
file_path: PaddleDetection/ppdet/utils/check.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import sys
  import paddle
  import six
  import paddle.version
  from .logger import setup_logger
label_desc: Use image node_id 4 for calling a global function with example usage: check_gpu(use_gpu) without return types