net.load_simple_network(restore_path + "actor.pth")
    # net.load_replay_buffer(restore_path+"replay.pkl") # 因为文件太大了,我删掉了默认的值
    net.load_norm(restore_path + "norm.pkl")
    trainer(net, env, args)


if __name__ == '__main__':
    # take the configuration for the HER
    # os.environ['OMP_NUM_THREADS'] = '1'
    # os.environ['MKL_NUM_THREADS'] = '1'
    # os.environ['IN_MPI'] = '1'

    # get the params
    args = get_args()
    os.environ['CUDA_VISIBLE_DEVICES'] = str(args.gpu_id)
    mpi_fork(args.cpu)
    from algos.tf1.td3_sp.TD3_per_her import TD3
    from algos.tf1.ddpg_sp.DDPG_per_her import DDPG
    from algos.tf1.sac_sp.SAC_per_her import SAC
    from algos.tf1.sac_auto.sac_auto_per_her import SAC_AUTO

    from algos.pytorch.td3_sp.td3_per_her import TD3Torch
    from algos.pytorch.ddpg_sp.ddpg_per_her import DDPGTorch
    from algos.pytorch.sac_sp.sac_per_her import SACTorch

    RL_list = [TD3, DDPG, SAC, SAC_AUTO, TD3Torch, DDPGTorch, SACTorch]

    [
        launch(net=net, args=args) for net in RL_list
        if net.__name__ == args.RL_name
    ]
Пример #2
0
 def thunk_plus():
     # Fork into multiple processes
     mpi_fork(cpu_num)
     # Run thunk
     thunk(thunk_params_dict_list)