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.rpm = ReplayMemory(args.rpm_size, OBS_DIM, ACT_DIM)
  
      if args.restore_rpm_path is not None:
          self.rpm.load(args.restore_rpm_path)
      if args.restore_model_path is not None:
          self.restore(args.restore_model_path)
  
      # add lock between training and predicting
      self.model_lock = threading.Lock()
  
      # add lock when appending data to rpm or writing scalars to summary
      self.memory_lock = threading.Lock()
  
      self.ready_actor_queue = queue.Queue()
  
      self.total_steps = 0
      self.noiselevel = 0.5
  
      self.critic_loss_stat = WindowStat(500)
      self.env_reward_stat = WindowStat(500)
      self.shaping_reward_stat = WindowStat(500)
      self.max_env_reward = 0
  
      # thread to keep training
      learn_thread = threading.Thread(target=self.keep_training)
      learn_thread.setDaemon(True)
      learn_thread.start()
  
      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 replay_memory import ReplayMemory
  from parl.utils.window_stat import WindowStat
  from parl.remote.client import get_global_client
  from parl.utils import machine_info
label_desc: Use image node_id 1 to create a new Learner object from inherited base classes: object with example: obj = Learner(args)