code: def __init__(self, args):
      if machine_info.is_gpu_available():
          assert (
              get_gpu_count() == 1
          ), "Only support training in single GPU,\
                      Please set environment variable: `export CUDA_VISIBLE_DEVICES=[GPU_ID_TO_USE]` ."
  
      else:
          cpu_num = os.environ.get("CPU_NUM")
          assert (
              cpu_num is not None and cpu_num == "1"
          ), "Only support training in single CPU,\
                      Please set environment variable:  `export CPU_NUM=1`."
  
      model = OpenSimModel(OBS_DIM, VEL_DIM, ACT_DIM)
      algorithm = parl.algorithms.DDPG(
          model,
          gamma=GAMMA,
          tau=TAU,
          actor_lr=ACTOR_LR,
          critic_lr=CRITIC_LR,
      )
      self.agent = OpenSimAgent(algorithm, OBS_DIM, ACT_DIM)
  
      self.evaluate_result = []
  
      self.lock = threading.Lock()
      self.model_lock = threading.Lock()
      self.model_queue = queue.Queue()
  
      self.best_shaping_reward = 0
      self.best_env_reward = 0
  
      if args.offline_evaluate:
          self.offline_evaluate()
      else:
          t = threading.Thread(target=self.online_evaluate)
          t.start()
  
      with self.lock:
          while True:
              model_path = self.model_queue.get()
              if not args.offline_evaluate:
                  # online evaluate
                  while not self.model_queue.empty():
                      model_path = self.model_queue.get()
              try:
                  self.agent.restore(model_path)
                  break
              except Exception as e:
                  logger.warn("Agent restore Exception: {} ".format(e))
  
          self.cur_model = model_path
  
      self.create_actors()
  
imports: import os
  import parl
  import queue
  import six
  import threading
  import time
  import numpy
  from actor import Actor
  from opensim_model import OpenSimModel
  from opensim_agent import OpenSimAgent
  from parl.utils import logger, summary, get_gpu_count
  from parl.utils.window_stat import WindowStat
  from parl.remote.client import get_global_client
  from parl.utils import machine_info
  from shutil import copy2
label_desc: Use image node_id 1 to create a new Evaluator object from inherited base classes: object with example: obj = Evaluator(args)