v1.0.5; add num_processes and support dual moe
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
# UPDATE
|
# UPDATE
|
||||||
## 20260106
|
## 20260106
|
||||||
### v1.0.5
|
### v1.0.5
|
||||||
1. `robogauge/scripts/server.py`加入`--port`设置端口配置选项
|
1. `robogauge/scripts/server.py`加入`--port`设置端口配置选项, 加入`--num-processes`设置并行进程数量
|
||||||
|
2. `go2_moe`新增dual_moe模型支持, 预测返回三个对象, `student_weights, actor_weights, action`
|
||||||
## 20260103
|
## 20260103
|
||||||
### v1.0.4
|
### v1.0.4
|
||||||
1. 加入save_additional_output参数, 启动会自动记录每个step的latent和weights
|
1. 加入save_additional_output参数, 启动会自动记录每个step的latent和weights
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ default_args_list = [
|
|||||||
'--stress-benchmark',
|
'--stress-benchmark',
|
||||||
'--stress-terrain-names', 'flat', 'wave', 'slope_fd', 'slope_bd', 'stairs_fd', 'stairs_bd', 'obstacle',
|
'--stress-terrain-names', 'flat', 'wave', 'slope_fd', 'slope_bd', 'stairs_fd', 'stairs_bd', 'obstacle',
|
||||||
# '--stress-terrain-names', 'flat', 'wave',
|
# '--stress-terrain-names', 'flat', 'wave',
|
||||||
'--num-processes', '30',
|
# '--num-processes', '30', # Set in CLI
|
||||||
'--seeds', '0', '1', '2',
|
'--seeds', '0', '1', '2',
|
||||||
'--search-seeds', '0', '1', '2', '3', '4',
|
'--search-seeds', '0', '1', '2', '3', '4',
|
||||||
'--frictions', '0.5', '0.75', '1.0', '1.25', '1.5', '1.75', '2.0', '2.25', '2.5',
|
'--frictions', '0.5', '0.75', '1.0', '1.25', '1.5', '1.75', '2.0', '2.25', '2.5',
|
||||||
@@ -95,6 +95,7 @@ def run_api_server(input_queue: multiprocessing.Queue, result_dict: dict, port=9
|
|||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('--port', type=int, default=9973, help='API server port')
|
parser.add_argument('--port', type=int, default=9973, help='API server port')
|
||||||
|
parser.add_argument('--num-processes', type=int, default=30, help='Number of parallel processes for StressPipeline')
|
||||||
args_cli = parser.parse_args()
|
args_cli = parser.parse_args()
|
||||||
print("🤖 RoboGauge Evaluation Server Starting...")
|
print("🤖 RoboGauge Evaluation Server Starting...")
|
||||||
ctx = multiprocessing.get_context('spawn')
|
ctx = multiprocessing.get_context('spawn')
|
||||||
@@ -122,7 +123,12 @@ def main():
|
|||||||
results_store[task_id] = {"status": ResponseStatus.PROCESSING}
|
results_store[task_id] = {"status": ResponseStatus.PROCESSING}
|
||||||
|
|
||||||
args_list = default_args_list.copy()
|
args_list = default_args_list.copy()
|
||||||
args_list += ['--model-path', task_data.model_path, '--task-name', task_data.task_name, '--experiment-name', task_data.experiment_name]
|
args_list += [
|
||||||
|
'--model-path', task_data.model_path,
|
||||||
|
'--task-name', task_data.task_name,
|
||||||
|
'--experiment-name', task_data.experiment_name,
|
||||||
|
'--num-processes', str(args_cli.num_processes),
|
||||||
|
]
|
||||||
args = parse_args(args_list)
|
args = parse_args(args_list)
|
||||||
|
|
||||||
print(f"📋 Running with args:")
|
print(f"📋 Running with args:")
|
||||||
|
|||||||
@@ -23,13 +23,23 @@ class Go2MoE(Go2):
|
|||||||
def get_action(self, obs: np.ndarray):
|
def get_action(self, obs: np.ndarray):
|
||||||
obs_tensor = torch.tensor(obs, dtype=torch.float32).unsqueeze(0).to(self.device)
|
obs_tensor = torch.tensor(obs, dtype=torch.float32).unsqueeze(0).to(self.device)
|
||||||
action, results = self.model(obs_tensor)
|
action, results = self.model(obs_tensor)
|
||||||
if isinstance(results, tuple) and len(results) == 2:
|
if isinstance(results, tuple):
|
||||||
weights, latent = results
|
latent = results[-1]
|
||||||
latent = latent.detach().cpu().numpy().squeeze(0) if latent is not None else None
|
latent = latent.detach().cpu().numpy().squeeze(0) if latent is not None else None
|
||||||
weights = weights.detach().cpu().numpy().squeeze(0) if weights is not None else None
|
student_weights = None
|
||||||
|
actor_weights = None
|
||||||
|
if len(results) >= 2:
|
||||||
|
student_weights = results[0]
|
||||||
|
student_weights = student_weights.detach().cpu().numpy().squeeze(0) if student_weights is not None else None
|
||||||
|
if len(results) >= 3:
|
||||||
|
actor_weights = results[1]
|
||||||
|
actor_weights = actor_weights.detach().cpu().numpy().squeeze(0) if actor_weights is not None else None
|
||||||
if self.cfg.control.save_additional_output:
|
if self.cfg.control.save_additional_output:
|
||||||
self.save_info['latent'].append(latent)
|
self.save_info['latent'].append(latent)
|
||||||
self.save_info['weights'].append(weights)
|
if student_weights is not None:
|
||||||
|
self.save_info['weights'].append(student_weights)
|
||||||
|
if actor_weights is not None:
|
||||||
|
self.save_info['actor_weights'].append(actor_weights)
|
||||||
action = action.detach().cpu().numpy().squeeze(0)[self.model2mj_idx]
|
action = action.detach().cpu().numpy().squeeze(0)[self.model2mj_idx]
|
||||||
self.last_action = action
|
self.last_action = action
|
||||||
target_dof_pos = action * self.action_scale + self.default_dof_pos
|
target_dof_pos = action * self.action_scale + self.default_dof_pos
|
||||||
|
|||||||
Reference in New Issue
Block a user